Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keycloak User federation using existing MySQL database for users authentication

I am trying to setup Keycloak server for our organisation. I have couple of questions.

  1. How can we use our existing user database to authenticate users - User Federation. Keycloak only has LADP/Kerberos options. Is there any custom plugin which can be used for MySQL user authentication or can we use existing connectors itself (LDAP/Kerberos) via some adapter for the database?
  2. Is it possible to have multiple Identity providers within Keycloak environment - (Have Keycloak as IDP for few services, while Keycloak Google IDP for other services).

I have followed the official documentation, but for some reason not able to view the content of the link. Any helpful links to proper guide would be great.

like image 469
Sagar Chilukuri Avatar asked Apr 29 '18 14:04

Sagar Chilukuri


People also ask

Which database does Keycloak use?

Supported databases By default, the server uses the dev-file database. This is the default database that the server will use to persist data and only exists for development use-cases.

What is user federation in Keycloak?

user federation provider. Keycloak can store and manage users. Often, companies already have LDAP or Active Directory services that store user and credential information. You can point Keycloak to validate credentials from those external stores and pull in identity information. identity provider.


1 Answers

I answered a similar question regarding existing databases user and keycloak authentication (link here)

I published my own solution as a multi RDBMS implementation (oracle, mysql, postgresl, sqlserver) to solve simple database federation needs, supporting bcrypt and several types of hashes.

It is a configurable keycloak custom provider, you will only need the to set some SQL queries and it is ready to use.

It is already compatible with new keycloak quarkus deployment.

Feel free to clone, fork, contribute or do whatever you need to solve your issue.

GitHub repo:

https://github.com/opensingular/singular-keycloak-database-federation

like image 127
Vinicius Uriel Avatar answered Oct 21 '22 12:10

Vinicius Uriel