-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Allow login through OpenID Connect #16221
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
Conversation
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.
Yesssssssss OpenID Connect and not a moment too soon ❤️ 🤟
Any chance we can get an example env var config like the other strategies in https://github.com/tootsuite/mastodon/blob/main/.env.nanobox? That would be excellent.
Have you tested this already? I'm curious to take it for a test run!
This works! 🔥 🔥 🔥 I published this image Example vars:
Example minimal working env var config (Keycloak SSO v12.0.4):
|
Hey @chandrn7 let me know if you need any further testing on this, can support. Thanks again 🚀 |
One bug: user autocompletion in the UI doesn't work unfortunately. Can you confirm @chandrn7? EDIT: actually, it seems OpenID Connect based accounts can't get @ autocompletion for local accounts? So a SSO logged in user cannot get autocomplete for @'s to their local instance admin (which is a local account). We're still testing this out. EDIT EDIT: Upon further testing, it seems only the first admin account is not @'able? We've tested with an additional local account and it works. The first admin account was created with |
Thanks for the help @decentral1se! I have tested it with different OpenID providers and have been using the code on an instance without issue, but any ideas you have for testing would be appreciated. I'm planning on working on a documentation pull request if the changes are merged. My minimal working env var config looks similar to yours:
As for the @ autocomplete, I haven't come across that issue. Could you give me some more detail? When you say @ autocomplete are you talking about @ functionality while posting or somewhere else? |
Where my initial admin account created with |
Can confirm that this doesn't break Tusky client logins either 💯 |
I wasn't able to reproduce it. Have you tried to replicate using a non-OIDC account? Maybe it's unrelated? |
Feature request: some option to set the "home page" (the thing that redirects to the Also is there any indication that this will be merged? We're running it in testing with no problems for a while now. |
I found it hard to find the SSO login buttons as well, so I have a branch where I add them to the /about page. I could create a separate pull request? Or add it to this one? No idea about the possibility of it being merged. @ClearlyClaire? |
Except for the fact that the Keycloak login is only on For those of you who can't wait for this to be merged, you can add a line in the AUR package's PKGBUILD to patch with this PR. See this ArchWiki page for more information. |
Most recent commits added SSO buttons to the |
@chandrn7 Showing a conflict on Gemfile.lock |
@weex Should be resolved now. |
omg is this getting merged 👁️ 🙏 |
Nice! |
Cause I didn't found the solution directly in here, just in linked issues, for everyone still experience OpenSSL / Certificate issues while trying to login via OpenID Connect, I followed this change (on an Ubuntu Server): |
The certificate issue is caused by dependency |
I found a fix for the certificate issue after much research here https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/30749/diffs. I added it to my local code to get httpclient to respect my openssl config. It's been working well for me. |
Add link to mastodon/mastodon#16221 until documentation can be fully updated.
We've discovered on our server two bugs related to OIDC. I'm wondering if they're deserving of new issues or should be discussed here.
For logout, the expected behavior when a user clicks "Logout" is that the application (Mastodon) should send them to the OIDC The current behavior on our system is that it simply presents a user a logout page, but since they're still logged into the identity provider, going back to Mastodon shows them as logged in. The second issue is that signup on OIDC should take the user to a user registration page. With keycloak I believe this is https://{keycloak_server}/auth/realms/{realm}/login-actions/registration?client_id={client_id} I'm less sure about this being correct, or discoverable, but the current behavior is that the signup button is present but non-functional. |
I'm trying to reproduce the same thing, but with Authentik instead of Keycloak. Particularly for OIDC_ISSUER, I guess it should point to https://authentik.company/ (of course with my own Authentik FQDN), but is the site root enough or does it need a path? EDIT : I also realized that if I put a "é" in OIDC_DISPLAY_NAME, Mastodon will show the mamouth smashing his computer when connecting (Error)... BTW, why there is nothing about OIDC_* at the environment variables list in the doc? |
This sounds like a separate issue worth reporting! As always, please join traces from |
Has anything changed in the way Mastodon handles OpenID since, > 4.2.0? Had my instance running well with SSO via authentik and now just get a blank screen when trying to log in via Single Sign-on? Already filed this at authentik (goauthentik/authentik#7372)? |
It's possible there have been Content-Security-Policy related changes. Which browser are you using? Do you have anything in the browser console? |
Those errors do not seem related—at least not on the Mastodon side of things. I'm not sure what could cause this. |
That's what I thought as well, so I went to debug the issue a little bit further - that's a refined output, maybe this helps? The nginx.conf is used from https://github.com/mastodon/mastodon/blob/main/dist/nginx.conf without any changes except the Let's Encrypt-certificates. |
So I have this connected now after a bit of fiddling, however my user that already existed on the mastodon server has the same email address as the one that exists in KeyCloak. This then presents me with: Error creating an account for this identity. Should this happen or should it prompt me to merge accounts on the mastodon server? |
@richarvey See this comment/issue: #20144 (comment) TLDR: it is not currently supported, but you might be able to do a manual migration. |
@richarvey you may want to try with |
How can i add mutiple OIDC providers? |
Addresses #7958. Allows login through OpenID Connect.
Also: