Spring OAuth2 - tokenInfoUri


Bryan Perino
 

Hello All,

I am using Spring Cloud Security with OAuth2 and am having an issue related to it not passing the scopes around. I believe that I need to define an endpoint to retrieve information about a given token (Including its scopes). However, I am getting an error stating that it is unauthorized.:

I have defined this endpoint for the token info: http://localhost:8080/uaa/check_token

Here is the error:

https://gist.github.com/bryantp/eb81d46b7beac9ee5011e5eca33a7a5c

I noticed that it is making a request to the endpoint, and the verbiage is correct. I am not sure what it could be sending wrong. This is related to this issue I found for Spring Boot and has to deal with Authorization on a per-method basis.

https://github.com/spring-projects/spring-boot/issues/5096

Thanks for any help.


Daniel Mikusa
 

On Thu, Jun 30, 2016 at 1:43 AM, Bryan Perino <Bryan.Perino(a)gmail.com>
wrote:

Hello All,

I am using Spring Cloud Security with OAuth2 and am having an issue
related to it not passing the scopes around. I believe that I need to
define an endpoint to retrieve information about a given token (Including
its scopes). However, I am getting an error stating that it is
unauthorized.:

I have defined this endpoint for the token info:
http://localhost:8080/uaa/check_token

Here is the error:

https://gist.github.com/bryantp/eb81d46b7beac9ee5011e5eca33a7a5c

Do you have logs from UAA? The UAA logs will sometimes tell you more about
the response you received.

Dan




I noticed that it is making a request to the endpoint, and the verbiage is
correct. I am not sure what it could be sending wrong. This is related to
this issue I found for Spring Boot and has to deal with Authorization on a
per-method basis.

https://github.com/spring-projects/spring-boot/issues/5096

Thanks for any help.


Bryan Perino
 


Bryan Perino
 

Here is the YML file configuration for Spring OAuth as well as the code that makes the POST call:

YML: https://gist.github.com/bryantp/fbf2f5a46aa883588b6f5230cae5248f

Code: https://gist.github.com/bryantp/70bf538626661a623f5099b704872938

Returns a 404


Bryan Perino
 

Figured it out. I needed to define more information in my application.yml. Namely, the client information

security:
oauth2:
client:
clientId: myId
clientSecret: my-secret
resource:
userInfoUri: http://localhost:8080/uaa/userinfo
tokenInfoUri: http://localhost:8080/uaa/check_token
preferTokenInfo: true