title: Spring Boot oauth2: How to set the resource parameter in the authorization request to make adfs happy?
body: <p>I'm trying to set up a spring boot app that uses oauth2 with Active Directory Federation Services as the authentication provider.  I started with the tutorial here...</p>
  
  <p><a href="https://spring.io/guides/tutorials/spring-boot-oauth2/" rel="nofollow">https://spring.io/guides/tutorials/spring-boot-oauth2/</a></p>
  
  <p>... and got the facebook example to work.  Then, I started adapting it to work with ADFS.  It is close to working, but ADFS expects a resource parameter to be passed with the authorization request and I can't figure out how to set it.  Here's what I've got so far in the config...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>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</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I click the login link, it redirects to <a href="https://domain/adfs/oauth2/authorize?client_id=spring-boot-test-client&amp;redirect_uri=http://localhost:8080/login&amp;response_type=code&amp;state=rjzfyZ" rel="nofollow">https://domain/adfs/oauth2/authorize?client_id=spring-boot-test-client&amp;redirect_uri=http://localhost:8080/login&amp;response_type=code&amp;state=rjzfyZ</a></p>
  
  <p>I've tried setting the security:oauth2:client:id, the security:oauth2:client:resourceids and the security:oauth2:resource:id, but none of those seemed to affect the first redirect.  Any idea what I should set to get the resource included in that first redirect?</p>