Mihail HRS
Mihail HRS

Reputation: 115

Java spring Multiple microservice with keycloack

I need to build microservice architecture like in the image. The question is how do I must authenticate users in resource service using keycloack. Do I must to get the token from UI app and add this token manually in the app or there is some automatic method using spring app to get info from the resource service?

enter image description here

If I need to add it manually then how can I get this token inside the app?

Upvotes: 0

Views: 314

Answers (1)

Alexander.Furer
Alexander.Furer

Reputation: 1869

Keycloak provides spring security integration module. It renders login form for your UI application that authenticates user against keycloak. The token is stored then in session. Keycloak plugin is responsible to validate the token against keycloak server.

https://github.com/keycloak/keycloak-documentation/blob/master/securing_apps/topics/oidc/java/spring-security-adapter.adoc

Upvotes: 1

Related Questions