-
Notifications
You must be signed in to change notification settings - Fork 26
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
Implement SSO via OIDC #127
base: next
Are you sure you want to change the base?
Conversation
|
Remaining work is hinted by some TODO comments. Login still unimplemented (only registration works). For unmojang#39
Apologies if this is out of scope or would be better asked in the original issue, but is there planned support for custom claims and using the retrieved info? To use Twitch as an example, they have a custom claim I understand if this request broadens this PR too much as it sounds like it might require a plugin type system to provide customized support, but you're likely the better judge for the requirements and how feasible this is. I can move this request to its own issue if that's preferred. Very excited for what this PR enables! |
Happy to discuss it here! Hadn't thought about custom claims yet.
It might be good to have a An example of the latter might be "every user with this OIDC claim should automatically get assigned a solid green cape when they create their account". For that kind of thing, I think that would be best done by a separate service that interacts with both the OIDC identity provider and the Drasl HTTP API. For that particular use case, we'd want to add an API route for getting a user by their username and maybe webhooks for triggering actions when a user creates an account/updates their account/etc. Drasl's HTTP API is my preference for building plugins/extensions. A true "plugin system" with e.g. https://github.com/traefik/yaegi would also be an option but Drasl's codebase isn't the cleanest and it would be a lot of work to maintain a stable plugin API. |
I should have been more familiar with the OIDC spec, I didn't realize how many of these claims were actually a part of the standard😅. In regards to When I mentioned a plugin type system, I was thinking about authorization and how to handle that. For example if a certain value returned by a claim isn't satisfactory, for example Seperately I was thinking about webhooks and how they would be cool for handling events and external interactions. I don't know if webhooks would be appropriate pattern for the usecase I outlined above however. |
Adds the ability to link one or more OIDC identity providers on the user page. I would also like to support the flow from logged out -> sign in via OIDC -> link existing account or create new? -> link existing account. That way, we can add a AllowPasswordLogin setting that forces users to migrate to OIDC login and doesn't allow them to log in via password, only link their account.
bc37580
to
9b19ada
Compare
OK I could do that, should be easy enough to implement and maintain. I assume that would be used with
We could add a Drasl config option
I could see webhooks being appropriate here. For example, a "CreateUser" webhook could respond |
96dfb52
to
6409760
Compare
Remaining work is hinted by some TODO comments. I'll make a checklist here too once I get a little farther. Login still unimplemented (only registration works). I'd like to get this in before releasing 3.0.0 due to the API and config schema changes.
I decided to go with https://github.com/zitadel/oidc instead of https://github.com/coreos/go-oidc since the former can implement an OIDC IDP ("server") as well as an RP ("client"), in case we want/need to become an IDP in the future.
For #39