jaraco / irc

Full-featured Python IRC library for Python.
MIT License
390 stars 84 forks source link

Add support for SASL #195

Closed jaraco closed 10 months ago

jaraco commented 2 years ago

Many popular IRC networks now require SASL auth in order to accept connections. This library should implement that.

jaraco commented 2 years ago

This library hints at how it may be done.

jaraco commented 2 years ago

Or maybe this.

jesopo commented 2 years ago

the process goes as follows (> is client-to-server, < is server-to-client)

< :server NOTICE * :*** Checking Ident
< :server NOTICE * :*** Looking up your hostname...
< :server NOTICE * :*** Found your hostname: localhost
< :server NOTICE * :*** No Ident response
> CAP LS
> USER u s e r
> NICK jess
< :server CAP * LS :account-notify extended-join sasl invite-notify
> CAP REQ sasl
< :server CAP * ACK :sasl
> AUTHENTICATE PLAIN
< AUTHENTICATE +
> AUTHENTICATE AGplc3MAaHVudGVyMg==
< :server 900 * jess!u@localhost jess :You are now logged in as jess
< :server 903 * :SASL authentication successful
> CAP END
< :server 001 jess :Welcome to the localhost Internet Relay Chat Network jess

AGplc3MAaHVudGVyMg== is a base64 of \x00jess\x00hunter2 which is \x00<account>\x00<password>

supertassu commented 2 years ago

This can be helpful too, as it's a SASL implementation with this library.