跳到主要内容

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 REPLY
       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 选项的实现都将支持本规范的全部内容.