Login with linked account and map to LDAP user

446 views
Skip to first unread message

Will Furnell

unread,
Sep 28, 2021, 9:17:23 AM9/28/21
to Keycloak User
Hello,
I'd like to be able to do the following with Keycloak - but I'm a bit stuck on the mapping stage and was wondering if anyone had any suggestions on how to achieve it please?

prerequisite: Keycloak is configured with an LDAP user federation to import accounts (but these accounts do NOT have passwords, so users cannot log into them directly), and an OpenID Connect IdP for login.

1. User logs in via the OpenIDC provider
2. Users OpenIDC login (linked account) is linked/bound/mapped to an existing LDAP user. We assume there is something in LDAP (either their email or sub or similar) that can be used to make sure that the user login in via an IdP is the same one in LDAP.
3. User is able to login with their identity provider, but their account username, details etc. are actually from LDAP

Is something like this possible please?
Thank you!
Will.

Sven-Torben Janus

unread,
Sep 30, 2021, 10:10:08 AM9/30/21
to Keycloak User
Hello Will,

the default First Broker Login flow should support this out of the box, if I am not mistaken.
If a user's email address within your LDAP is identical to the one retrieved from the IdP, Keycloak should execute the "Handle Existing Account" sub-flow. You may then want to verify the existing account by email instead of re-authentication.

Best regards
Sven-Torben

Will Furnell

unread,
Oct 4, 2021, 6:38:23 AM10/4/21
to Keycloak User
Thank you! I'll give this a try,
Will.
Reply all
Reply to author
Forward
0 new messages