I've implemented a rudimentary resource server, auth server, and client inspired by the sparklr/tonr examples, but with separate auth server and resource server implementations. I'm trying to implement the implicit grant flow using version 1.0.0.RC2.
When my sample client attempts to access the protected resource using OAuth2RestTemplate, I get the following error:
Instead, I was expecting the protected resource to redirect the RestTemplate request to /oauth/authorize.Code:error="access_denied", error_description="Error requesting access token." at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:100) at org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider.obtainAccessToken(ImplicitAccessTokenProvider.java:61) at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainNewAccessTokenInternal(AccessTokenProviderChain.java:142) at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainAccessToken(AccessTokenProviderChain.java:118) at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:196) at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:148) at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:89) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:434) at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:122) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213)
My client security config for the authorization code flow was:
For implicit flow, I've created another client:Code:<oauth:resource id="rs" type="authorization_code" client-id="client1" client-secret="${password}" access-token-uri="${accessTokenUri}" user-authorization-uri="${userAuthorizationUri}" scope="read" />
What am I doing wrong?Code:<oauth:resource id="rs" type="implicit" client-id="client2" client-secret="${password}" access-token-uri="${accessTokenUri}" user-authorization-uri="${userAuthorizationUri}" scope="read" />


Reply With Quote
