6. 实现规则
WILL 和 DO 仅在连接开始时用于获取和授予后续协商的权限.
认证只在一个方向上进行协商. 服务器必须发送 "DO", 客户端必须发送 "WILL". 此限制源于认证的性质. 存在三种可能的情况: 服务器认证客户端, 客户端认证服务器, 以及服务器与客户端相互认证. 通过只在一个方向上协商该选项, 再通过子选项确定使用的是这三种情况中的哪一种, 就消除了潜在的歧义. 如果服务器收到 "DO", 它必须以 "WONT" 响应. 如果客户端收到 "WILL", 它必须以 "DONT" 响应.
两台主机交换了 DO 和 WILL 之后, 服务器就可以自由请求认证信息. 在请求中, 会发送一份受支持的认证类型列表. 只有服务器可以发送请求 ("IAC SB AUTHENTICATION SEND authentication-type-pair-list IAC SE"). 只有客户端可以通过 "IAC SB AUTHENTICATION IS authentication-type ... IAC SE" 命令传送认证信息. 只有服务器可以发送回复 ("IAC SB AUTHENTICATION REPLY authentication-type ... IAC SE"). 根据所选的特定认证方案, 可以按需交换任意多次 IS 和 REPLY 子选项.
如果客户端不支持 authentication-type-pair-list 中列出的任何认证类型, 则应在 IS 回复中使用 NULL 类型来表明这一点. 注意, 在这种情况下, 服务器可以选择关闭连接.
认证类型的顺序必须 (MUST) 按照对不同认证类型的偏好来排列, 第一种类型最优先, 最后一种类型最不优先.
以下是使用该选项的示例:
Client Server
IAC DO AUTHENTICATION
IAC WILL AUTHENTICATION
[ The server is now free to request authentication information.
]
IAC SB AUTHENTICATION SEND
KERBEROS_V4 CLIENT|MUTUAL
KERBEROS_V4 CLIENT|ONE_WAY IAC
SE
[ The server has requested mutual Kerberos authentication, but is
willing to do just one-way Kerberos authentication. The client
will now respond with the name of the user that it wants to log
in as, and the Kerberos ticket. ]
IAC SB AUTHENTICATION NAME "joe"
IAC SE
IAC SB AUTHENTICATION IS
KERBEROS_V4 CLIENT|MUTUAL AUTH 4
7 1 67 82 65 89 46 67 7 9 77 0
48 24 49 244 109 240 50 208 43
35 25 116 104 44 167 21 201 224
229 145 20 2 244 213 220 33 134
148 4 251 249 233 229 152 77 2
109 130 231 33 146 190 248 1 9
31 95 94 15 120 224 0 225 76 205
70 136 245 190 199 147 155 13
IAC SE
[ The server responds with an ACCEPT command to state that the
authentication was successful. ]
IAC SB AUTHENTICATION REPLY
KERBEROS_V4 CLIENT|MUTUAL ACCEPT
IAC SE
[ Next, the client sends across a CHALLENGE to verify that it is
really talking to the right server. ]
IAC SB AUTHENTICATION IS
KERBEROS_V4 CLIENT|MUTUAL
CHALLENGE xx xx xx xx xx xx xx
xx IAC SE
[ Lastly, the server sends across a RESPONSE to prove that it
really is the right server.
IAC SB AUTHENTICATION REPLY
KERBEROS_V4 CLIENT|MUTUAL
RESPONSE yy yy yy yy yy yy yy yy
IAC SE
预计任何支持 Telnet AUTHENTICATION 选项的实现都将支持本规范的全部内容.