]> jfr.im git - solanum.git/blame - doc/features/sasl.txt
modules/m_challenge.c: log correct mechanism
[solanum.git] / doc / features / sasl.txt
CommitLineData
0c8f86ec
JT
1SASL authentication
2-------------------
3
f3319b3b
MM
4Note: The primary location for this document is now the IRCv3 sasl-3.1
5specification, at address:
6
7 http://ircv3.atheme.org/extensions/sasl-3.1
8
0c8f86ec 9This document describes the client protocol for SASL authentication, as
f3319b3b 10implemented in Charybdis and Atheme. The SASL protocol in general is documented
423d875b
MM
11in RFC 4422 [1], along with the 'EXTERNAL' mechanism. The most commonly used
12'PLAIN' mechanism is documented in RFC 4616 [2].
0c8f86ec 13
423d875b 14SASL authentication relies on the CAP client capability framework [3].
0c8f86ec
JT
15Support for SASL authentication is indicated with the "sasl" capability.
16The client MUST enable the sasl capability before using the AUTHENTICATE
17command defined by this specification.
18
19The AUTHENTICATE command
20
21The AUTHENTICATE command MUST be used before registration is complete and
22with the sasl capability enabled. To enforce the former, it is RECOMMENDED
23to only send CAP END when the SASL exchange is completed or needs to be
24aborted. Clients SHOULD be prepared for timeouts at all times during the SASL
25authentication.
26
27There are two forms of the AUTHENTICATE command: initial client message and
28later messages.
29
30The initial client message specifies the SASL mechanism to be used. (When this
31is received, the IRCD will attempt to establish an association with a SASL
32agent.) If this fails, a 904 numeric will be sent and the session state remains
33unchanged; the client MAY try another mechanism. Otherwise, the server sends
34a set of regular AUTHENTICATE messages with the initial server response.
35
36initial-authenticate = "AUTHENTICATE" SP mechanism CRLF
37
38A set of regular AUTHENTICATE messages transmits a response from client to
39server or vice versa. The server MAY intersperse other IRC protocol messages
40between the AUTHENTICATE messages of a set. The "+" form is used for an empty
41response. The server MAY place a limit on the total length of a response.
42
43regular-authenticate-set = *("AUTHENTICATE" SP 400BASE64 CRLF)
44 "AUTHENTICATE" SP (1*399BASE64 / "+") CRLF
45
46The client can abort an authentication by sending an asterisk as the data.
47The server will send a 904 numeric.
48
49authenticate-abort = "AUTHENTICATE" SP "*" CRLF
50
51If authentication fails, a 904 or 905 numeric will be sent and the
52client MAY retry from the AUTHENTICATE <mechanism> command.
53If authentication is successful, a 900 and 903 numeric will be sent.
54
55If the client attempts to issue the AUTHENTICATE command after already
56authenticating successfully, the server MUST reject it with a 907 numeric.
57
58If the client completes registration (with CAP END, NICK, USER and any other
59necessary messages) while the SASL authentication is still in progress, the
60server SHOULD abort it and send a 906 numeric, then register the client
61without authentication.
62
63This document does not specify use of the AUTHENTICATE command in
64registered (person) state.
65
66Example protocol exchange
67
68C: indicates lines sent by the client, S: indicates lines sent by the server.
69
70The client is using the PLAIN SASL mechanism with authentication identity
71jilles, authorization identity jilles and password sesame.
72
73C: CAP REQ :sasl
74C: NICK jilles
75C: USER jilles cheetah.stack.nl 1 :Jilles Tjoelker
76S: NOTICE AUTH :*** Processing connection to jaguar.test
77S: NOTICE AUTH :*** Looking up your hostname...
78S: NOTICE AUTH :*** Checking Ident
79S: NOTICE AUTH :*** No Ident response
80S: NOTICE AUTH :*** Found your hostname
81S: :jaguar.test CAP jilles ACK :sasl
82C: AUTHENTICATE PLAIN
83S: AUTHENTICATE +
84C: AUTHENTICATE amlsbGVzAGppbGxlcwBzZXNhbWU=
85S: :jaguar.test 900 jilles jilles!jilles@localhost.stack.nl jilles :You are now logged in as jilles.
86S: :jaguar.test 903 jilles :SASL authentication successful
87C: CAP END
88S: :jaguar.test 001 jilles :Welcome to the jillestest Internet Relay Chat Network jilles
89<usual welcome messages>
90
91Note that the CAP command sent by a server includes the user's nick or *,
92differently from what [1] specifies.
93
94Alternatively the client could request the list of capabilities and enable
95an additional capability.
96
97C: CAP LS
98C: NICK jilles
99C: USER jilles cheetah.stack.nl 1 :Jilles Tjoelker
100S: NOTICE AUTH :*** Processing connection to jaguar.test
101S: NOTICE AUTH :*** Looking up your hostname...
102S: NOTICE AUTH :*** Checking Ident
103S: NOTICE AUTH :*** No Ident response
104S: NOTICE AUTH :*** Found your hostname
105S: :jaguar.test CAP * LS :multi-prefix sasl
106C: CAP REQ :multi-prefix sasl
107S: :jaguar.test CAP jilles ACK :multi-prefix sasl
108C: AUTHENTICATE PLAIN
109S: AUTHENTICATE +
110C: AUTHENTICATE amlsbGVzAGppbGxlcwBzZXNhbWU=
111S: :jaguar.test 900 jilles jilles!jilles@localhost.stack.nl jilles :You are now logged in as jilles.
112S: :jaguar.test 903 jilles :SASL authentication successful
113C: CAP END
114S: :jaguar.test 001 jilles :Welcome to the jillestest Internet Relay Chat Network jilles
115<usual welcome messages>
116
423d875b
MM
117[1] A. Melnikov (Isode Limited), K. Zeilenga (OpenLDAP Foundation), Simple
118Authentication and Security Layer (SASL). June 2006.
119<https://tools.ietf.org/html/rfc4422>
120
121[2] K. Zeilenga (OpenLDAP Foundation), The PLAIN Simple Authentication and
122Security Layer (SASL) Mechanism. August 2006.
123<https://tools.ietf.org/html/rfc4616>
124
125[3] K. Mitchell, P. Lorier (Undernet IRC Network), L. Hardy (ircd-ratbox), P.
0c8f86ec
JT
126Kucharski (IRCnet), IRC Client Capabilities Extension. March 2005.
127This internet-draft has expired; it can still be found on
128http://www.leeh.co.uk/draft-mitchell-irc-capabilities-02.html
129