0

I'm trying to configure a Spring Boot 1.5.0 application with Spring Security OAuth2, and my userInfo server is form-based. I have to send the access_token in a form-urlencoded way (not in a Header like "Authorization: Bearer ...").

Debugging in my IDE, I changed the authorizationScheme to "form", on UserInfoRestTemplate just like this example below:

DefaultUserInfoRestTemplateFactory

It worked as I expected. The RestTemplate generated a "www-form-urlencoded", and the server responded with the user informations as I expected.

But now I'm not able to identify how do I make the change on application.yaml to make the same behaviour. I tryed some variations but without success (like this example below)

application.yaml

Anybody knows how's the correct way to set it up ?

Thanks in advance

1 Answers1

0

Here is an example:

security:
  oauth2:
    client:
      client-id: acme
      client-secret: acmesecret
      scope: read,write
      auto-approve-scopes: '.*'

facebook:
  client:
    clientId: 233668646673605
    clientSecret: 33b17e044ee6a4fa383f46ec6e28ea1d
    accessTokenUri: https://graph.facebook.com/oauth/access_token
    userAuthorizationUri: https://www.facebook.com/dialog/oauth
    tokenName: oauth_token
    authenticationScheme: form
    clientAuthenticationScheme: form
  resource:
    userInfoUri: https://graph.facebook.com
Morteza Soleimani
  • 2,652
  • 3
  • 25
  • 44