【问题标题】:OAuth2 redirection - oauth2/authorization/oidcOAuth2 重定向 - oauth2/authorization/oidc
【发布时间】:2021-03-09 02:42:03
【问题描述】:

我正在尝试使用 Jhipster 微服务设置 (V 6.10.5) 了解 OAuth2

  1. Jhipster 注册表
  2. 使用 --skip-server 生成的网关 UI (Angular)
  3. 使用 --skip-client 生成的网关服务器
  4. 钥匙斗篷。

当我启动所有这些服务时,一切都按预期工作。

我正在查看 Angular 项目,但在我看到的“login.service.ts”文件中找不到任何 oauth2 库,

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

但在网关服务器端,我找不到任何配置/代码可以将此调用重定向到 Keycloak 登录页面。有人可以帮助我了解此呼叫重定向的工作原理吗?

注意:我也生成了带有 UI 和服务器的网关,但代码似乎相同。

【问题讨论】:

    标签: oauth-2.0 keycloak jhipster jhipster-gateway


    【解决方案1】:

    如果您使用响应式 webflux 堆栈,则通过此过滤器完成重定向:

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

    如果你使用servlet堆栈,重定向是通过过滤器完成的:

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

    【讨论】:

      猜你喜欢
      • 2021-03-16
      • 2022-12-22
      • 2020-07-04
      • 1970-01-01
      • 2013-11-19
      • 2021-08-30
      • 2018-12-15
      • 2022-07-07
      • 2020-06-03
      相关资源
      最近更新 更多