Dwaraka
Dwaraka

Reputation: 179

OAuth2 redirection - oauth2/authorization/oidc

I am trying to understand OAuth2 using a Jhipster microservice setup (V 6.10.5)

  1. Jhipster Registry
  2. Gateway UI (Angular) generated using --skip-server
  3. Gateway server generated using --skip-client
  4. Keycloak.

When I bring up all these services, everything is working as expected.

I am looking at the Angular project and couldn't find any oauth2 library instead in the "login.service.ts" file I see,

location.href = `${location.origin}${this.location.prepareExternalUrl('oauth2/authorization/oidc')}`;

but on the Gateway server side I am unable to find any config/code that re-directs this call to the Keycloak login page. Can someone help me understand how this call re-direct works.

Note: I also generated the Gateway with UI and server together but the code seems to be the same.

Upvotes: 0

Views: 930

Answers (1)

R. Ding
R. Ding

Reputation: 11

If you use reactive webflux stack, the redirect is done through this filter:

org.springframework.security.oauth2.client.web.server.OAuth2AuthorizationRequestRedirectWebFilter

If you use servlet stack, the redirect is done through filter:

org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter

Upvotes: 1

Related Questions