I have spring boot app and I use keycloak as auth. provider.
For my realm I have set FACEBOOK or GOOGLE as identity providers.
I wonder how can I find out what identity provider user used - NOT via keycloak admin console, BUT in runtime.
eg.:
user A - FACEBOOK
user B - FACEBOOK
user C - GOOGLE
You can set a "User Session Note" mapper to your client's mappers. Set the User Session Note field to: identity_provider

Note: you can use identity_provider_identity in User Session Note field to get its username from to identity provider https://www.keycloak.org/docs/latest/server_admin/index.html#available-user-session-data
Map metadata given in the access token, such as facebook/google user id, and import these to the keycloak user. If you then provide this metadata to the clients, they can see which identity broker that was used.
https://keycloak.gitbooks.io/server-adminstration-guide/content/topics/identity-broker/mappers.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With