Search code examples
authenticationserviceldapkeycloakidp

Use keycloak as auth service or IDP?


So, im doing research to know if its a good alternative to implement keycloak on the environment i'm working at. Im using LDAP to manage users at my workingplace. I was wondering if is there a way to use keycloak as auth service in all upcoming systems and some of the existing ones. We are currently managing it with an IDP that we need to improve or replace, also there are some systems use their own login (this will eventually change). The main problem i've crossed is that keycloak synchronizes against ldap and i dont want user data to be stored on keycloak, maybe if its only login data. User data is planned to be kept only on ldap's database in case that any userdata needs to be updated.

So is there a way to use keycloak only as an auth service fetching user credentials from ldap on every auth request?

pd: maybe i am mistaken on the meaning of what's an auth service an whats an IDP.


Solution

  • Actually it is not necessary that LDAP users are synced to Keycloak. Keycloak supports both options

    • Importing and optionally syncing users from LDAP to Keycloak

    or

    • Always getting the User info from LDAP directly.

    But keycloak will always generate some basic federated user in it's database (e.g. for keeping up a session when using OpenID Connect - but you should not really care about that).

    As far as I know (but I've not used that myself) you could also use keycloak to maintain the LDAP users data and write changes back to LDAP (see "Edit Mode" in Keycloak documentation)

    Check Keycloak documentation regarding LDAP stuff to get more information https://www.keycloak.org/docs/6.0/server_admin/#_ldap

    Beside the User-Data Topic, Keycloak provides a lot of different Protocols (like SAML and OpenIDConnect) to provide authentication for your services. So you could use different/multiple authentication protocols depending on your applications with just one "LDAP-Backend"