Skip to content
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

Groups #12

Open
simon-an opened this issue Sep 15, 2022 · 1 comment
Open

Groups #12

simon-an opened this issue Sep 15, 2022 · 1 comment

Comments

@simon-an
Copy link

Hey there,

thanks for providing this awesome crate. 👍

Are there any plans to support groups?

BR Simon

@dsferruzza
Copy link
Owner

Hi!

To my knowledge there is no standard JWT claim that contains the list of groups a user is in.
If you want this in your JWT, you have to create a Group Membership mapper in Keycloak and it could have any claim name you want.
This is why my lib does not do this out of the box.

But the good is: it is quite simple to do!
Once you have configured Keycloak to include groups in JWTs (create a Client Scope with a Group Membership mapper and use this scope in a Client), you just need to define a Deserialize struct with any claim you want (see this example) and use it in your handler's extractor.

Let me know if something does not make sense to you or if I missed something!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants