1
votes

I have an WebApp, which uses Grant-Type: password, to send user name and password to get the bearer token using inbuilt user name and password configured in keycloak.

My requirement is :

After receiving the token request from WebApp, keycloak should communicate with an external microservice and fetch the value returned from the micro service, before sending the token to WebApp.

Based on the microservice value,

If value is true, keycloak should send bearer token to WebApp

If value is false, keycloak should send the result as authentication failed to WebApp.

I would like to know is there any settings available or external jar can be added in keycloak to communicate with micro service and get the results?

I read the documentation provided in keycloak and did some research online but so far I am not able to find anything related to the same.

https://www.keycloak.org/docs/3.0/server_development/topics/providers.html

1

1 Answers

1
votes

Have you looked the auth provider SPI walkthrough ? https://www.keycloak.org/docs/latest/server_development/index.html#_auth_spi_walkthrough

It shows how to implement your own auth provider, fitting the call to your microservice should be pretty trivial.