bleumink / streamlit-keycloak

User authentication and single sign-on in your Streamlit app using Keycloak
MIT License
59 stars 11 forks source link

Group membership #7

Closed bqueguin closed 1 year ago

bqueguin commented 1 year ago

Hi Gadeon,

In the return dict user_info, I don't see any entry for the groups of the user. And after reading your README.md, I understood that it is implemented, am I right?

Have you got informations about groups with your configuration?

bleumink commented 1 year ago

Hi Bruno,

I had to look this up myself as well. The userinfo endpoint does not provide the group memberships by default, so will have to enable this yourself. To do this, open the client in the admin interface. Then go to 'client scopes' and open the dedicated scope and mappers for the client. Here you can configure a new mapper. Choose the 'groups membership' preset and configure it something like this: mapper

I'll probably include something along these lines in the documentation as well.

bqueguin commented 1 year ago

It works perfectly! Thanks!

Yes I think to add this in documentation could be usefull because it's not obvious how to add the group membership information into the output :)