【问题标题】:Setting end session endpoint设置结束会话端点
【发布时间】:2021-07-20 20:27:44
【问题描述】:

在 DMZ 中配置 Spring Boot 客户端并使用以下方式配置 Spring Security OAuth:

issuer-uri: https://authentication_server/auth/realms/my-realm

我从 Spring Security 收到此错误:

The Issuer "https://external_url/auth/realms/my-realm" provided in the configuration metadata did not match the requested issuer "https://authentication_server/auth/realms/my-realm

this post了解到,我需要指定authorization-uritoken-urijwk-set-uri而不是issuer-uri,然后它也可以工作。

authorization-uri: https://external_url/auth/realms/my-realm/protocol/openid-connect/auth
token-uri: https://authentication_server/auth/realms/my-realm/protocol/openid-connect/token
jwk-set-uri: https://authentication_server/auth/realms/my-realm/protocol/openid-connect/certs

(我不明白为什么 Spring Security 在单独设置值时无法使用 issuer-uri 中的相同值自动配置)

现在的问题是注销停止工作。使用 issuer-uri 时,OAuth 是自动配置的,end_session_endpoint 是从答案中获取的,但是在指定每个设置时,无法指定 end_session_endpoint

这是 Spring Security OAuth 中的一个突出问题,还是我需要进行不同的配置?

【问题讨论】:

    标签: spring-boot spring-security spring-security-oauth2


    【解决方案1】:

    我不得不解决这个问题。我很快就开始复制现有的OidcClientInitiatedLogoutSuccessHandler,我已经在配置 LogoutRedirectUri 时使用了它。

    我只是简单地复制了该类并更改了方法 endSessionEndpoint() 的实现以返回由我们的 OAuth 服务器返回为 end_session_endpoint 的 URI。

    这个问题是tracked in spring-security GitHub。 可能的修复是allowing to add "Additional attributes for ClientRegistration and ProviderDetails"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-15
      • 2016-03-04
      • 2019-11-23
      • 2011-04-13
      • 2018-11-23
      • 2015-02-04
      • 2016-11-18
      • 2023-03-25
      相关资源
      最近更新 更多