Skip to content
Advertisement

create keycloak endpoint to provide custom authentication

I am trying to extend keycloak by creating a new endpoint to authenticate users.

The point is, user is not stored in keycloak, the user is stored in an external system.

The external system will call the new endpoint and provide token (will contains user info), clientId, and clientSecret. and (somehow) we will verify the existence of the user.

The challenge I am facing right now is I cannot create a session for the user. (seems the session requires existed user in keycloak, I am using InMemoryUser)

JavaScript

I am using code from here but the use case is differnt.

Advertisement

Answer

I solved by saving the user in the cache (db) if not exist:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement