简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM