ibuetler / docker-keycloak-traefik-workshop

Docker with Keycloak and Traefik Workshop
243 stars 43 forks source link

Keycloak data in the app beyond the auth #3

Closed niekvlessert closed 5 years ago

niekvlessert commented 5 years ago

Thank you for this great tutorial! Everything works fine overhere.

What I would like to know is how to access data in Keycloak from the currently logged in user from the app beyond the authentication, so that it can for example show the user name and get certain permissions from Keycloak. I can imagine it's the rest interface and I need some session information or something, but I don't really know where to start.

Got any tips?

ibuetler commented 5 years ago

If you are using OIDC (Open-ID-Connect), such information will be sent to you by JWT token. UserID, E-Mail and such will be sent without changing the keycloak configuration. If you want to get roles, permissions and more, you need to configure keycloak and define if these properties shall be added to the JWT token.

niekvlessert commented 5 years ago

Thx, just the tip I needed! Might add a line to the tutorial. Regards Niek