Re: Spring OAuth not retrieving scopes from UAA


Madhura Bhave
 

Hi Brian,

The scopes that end up in the access token are the intersection of the client scopes and the user scopes. Which oauth client have you configured your spring cloud application with?

Thanks,
Madhura

On Jun 27, 2016, at 2:57 PM, Bryan Perino <Bryan.Perino(a)gmail.com> wrote:

Hello All,

Brand new to Cloud Foundry. I have hooked up a Spring Cloud Application to a UAA server and gotten it to authenticate properly. However, I noticed that none of the scopes that I defined in uaa.yml for the user are showing up in the resource server backend.

Here is a link to the debugging session of what I can see: http://imgur.com/6wTYpQD
Here is the code I am debugging:

@RequestMapping("/")
public Message home(OAuth2Authentication principal) {
System.out.println(principal.getName());
return new Message("Hello World");
}

The screenshot is the value of the 'principal' variable. I have set the Spring Security yml variables for the resource server like so:

security:
oauth2:
resource:
userInfoUri: http://localhost:8080/uaa/userinfo

and here is the relevant parts from the uaa.yml:

https://gist.github.com/bryantp/2bfc4538f36f28ba285fda84c59b89f8

Thanks for any help.

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.