【问题标题】:Spring Boot oauth2: How to set the resource parameter in the authorization request to make adfs happy?Spring Boot oauth2:如何在授权请求中设置资源参数让adfs开心?
【发布时间】:2016-08-20 15:45:27
【问题描述】:

我正在尝试设置一个使用 oauth2 和 Active Directory 联合身份验证服务作为身份验证提供程序的 Spring Boot 应用程序。我从这里的教程开始...

https://spring.io/guides/tutorials/spring-boot-oauth2/

... 并让 facebook 示例正常工作。然后,我开始调整它以与 ADFS 一起使用。它接近工作,但 ADFS 期望资源参数与授权请求一起传递,我不知道如何设置它。这是我目前在配置中得到的...

security:
    oauth2:
        client:
            clientId: spring-boot-test-client
            userAuthorizationUri: https://domain/adfs/oauth2/authorize
            access-token-uri: https://domain/adfs/oauth2/token
            tokenName: code
            authenticationScheme: query
            clientAuthenticationScheme: form
            grant-type: authorization_code

当我点击登录链接时,它会重定向到https://domain/adfs/oauth2/authorize?client_id=spring-boot-test-client&redirect_uri=http://localhost:8080/login&response_type=code&state=rjzfyZ

我尝试设置 security:oauth2:client:id、security:oauth2:client:resourceids 和 security:oauth2:resource:id,但这些似乎都不会影响第一次重定向。知道我应该设置什么来获取第一个重定向中包含的资源吗?

【问题讨论】:

    标签: spring-boot spring-security-oauth2 adfs3.0


    【解决方案1】:

    在这里回答我自己的问题...这可能是一个 hack,但我只是将资源附加到 userAuthorizationUri

    security:
        oauth2:
            client:
                clientId: spring-boot-test-client
                userAuthorizationUri: https://domain/adfs/oauth2/authorize?resource=RelyingPartyTrustIdentifier
                access-token-uri: https://domain/adfs/oauth2/token
                tokenName: code
                authenticationScheme: query
                clientAuthenticationScheme: form
                grant-type: authorization_code

    现在,我正在获取登录表单。

    【讨论】:

    • 您是否使用 ADFS 作为身份提供者?
    猜你喜欢
    • 2018-08-29
    • 2019-11-18
    • 2016-05-21
    • 2014-07-09
    • 1970-01-01
    • 2015-05-14
    • 2022-08-03
    • 2022-08-04
    • 2015-11-19
    相关资源
    最近更新 更多