Spring Boot oauth2:如何设置授权请求中的资源参数让adfs开心?

use*_*379 3 spring-boot spring-security-oauth2 adfs3.0

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

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
Run Code Online (Sandbox Code Playgroud)

当我单击登录链接时,它会重定向到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,但这些似乎都不会影响第一次重定向。知道我应该设置什么来获取包含在第一次重定向中的资源吗?

use*_*379 6

在这里回答我自己的问题......这可能是一个黑客,但我只是将资源附加到 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
Run Code Online (Sandbox Code Playgroud)

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