4. Exemples
L'utilisateur « joe » peut souhaiter se connecter en tant qu'utilisateur « pete » sur la machine « foo ». Si « pete » a configuré « foo » pour autoriser « joe » à accéder à son compte, le client enverra IAC SB AUTHENTICATION NAME "pete" IAC SE IAC SB AUTHENTICATION IS SPX AUTH <joe's spx authentication token> IAC SE. Le serveur authentifiera alors l'utilisateur en tant que « joe » à partir des informations du jeton, et renverra ACCEPT ou REJECT. Si l'authentification mutuelle est utilisée, le serveur inclura une réponse mutuelle dans le message ACCEPT. La vérification d'autorisation visant à déterminer si « pete » autorise « joe » à utiliser son compte est effectuée une fois l'échange d'authentification terminé. Par conséquent, il est possible que le client reçoive une réponse ACCEPT (fondée sur le jeton d'authentification), mais que joe se voie refuser l'accès au compte de pete.
Client Server
IAC DO AUTHENTICATION
IAC WILL AUTHENTICATION
[ The server is now free to request authentication information.
]
IAC SB AUTHENTICATION SEND SPX
CLIENT|MUTUAL SPX CLIENT|ONE_WAY
IAC SE
[ The server has requested mutual SPX authentication. If mutual
authentication is not supported, then the server is willing to
do one-way SPX authentication. ]
[ The client will now respond with the name of the user that it
wants to log in as, and the SPX authentication token. ]
IAC SB AUTHENTICATION NAME
"pete" IAC SE
IAC SB AUTHENTICATION IS SPX
CLIENT|MUTUAL AUTH <spx
authentication token
information> IAC SE
[ The server responds with an ACCEPT command to state that the
authentication was successful. ]
[ If AUTH_HOW_MUTUAL, the server responds with the mutual
response so the client can verify that it is really talking to
the right server. ]
[ If AUTH_HOW_ONE_WAY, the server responds with a NULL mutual
response, since the client is willing to trust the server
already. ]
IAC SB AUTHENTICATION REPLY SPX
CLIENT|MUTUAL ACCEPT <mutual
response> IAC SE