-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add external authentication mechanism #101
base: master
Are you sure you want to change the base?
Conversation
@fredipevcin: Why have you closed your PR? |
@Neustradamus: because there were no activity. |
@mattn: What do you think about this PR? |
Could you please fix conflict? |
@fredipevcin: Have you seen the @mattn comment? |
Could you please fix conflict? |
Hey, I will try to fix this as soon as possible (week or 2). You are welcome to do it otherwise I will when time allows me. |
Had an issue with tests.. so I removed them. If you have a suggestion how to add them, let me know. Another thing I noticed during the testing. If server respond with multiple mechanism then the first one will be selected ( <stream:stream xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
to='domain'
version='1.0'>
<stream:features>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>PLAIN</mechanism>
<mechanism>X-OAUTH2</mechanism>
</mechanisms>
</stream:features> |
@Neustradamus @mattn If this is good enough for you you can merge it. It's been a long time since I use this. I can't even test it. |
It should prefer SCRAM mechanisms over PLAIN. If you want to use OAUTH or EXTERNAL I guess you'll tell the lib to do so by the setting.
I have no idea about tests. Maybe @mattn knows more.
Am 24. November 2023 12:59:01 UTC schrieb Fredi Pevcin ***@***.***>:
…Had an issue with tests.. so I removed them. If you have a suggestion how to add them, let me know.
Another thing I noticed during the testing. If server respond with multiple mechanism then the first one will be selected (`PLAIN`). Not sure if this is good thing.
```xml
<stream:stream xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
to='domain'
version='1.0'>
<stream:features>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>PLAIN</mechanism>
<mechanism>X-OAUTH2</mechanism>
</mechanisms>
</stream:features>
```
|
@fredipevcin: Have you seen the @mdosch comment? |
@fredipevcin: What is your email address? |
@fredipevcin I also don't have a server using external authentication and am therfore also unable to test it. :( |
@@ -181,6 +181,9 @@ type Options struct { | |||
// provided to the server as the xmlns:auth attribute of the OAuth2 authentication request. | |||
OAuthXmlNs string | |||
|
|||
// AuthExternal will be chosen if this is set to true and if server supports it | |||
AuthExternal bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Mechanism
could also be used for setting auth to EXTERNAL
: https://github.com/xmppo/go-xmpp/blob/master/xmpp.go#L234
No description provided.