I'm testing spring security oauth 2 (the last RC) with facebook. To log in users based on facebook connect i use a oauth2 rest template to get the facebook id. unfortunately when the template tries to request the token based on the code it doesn't add the redirect_uri to the request.
when i debugged this i found out that AccessTokenRequest.getCurrentUri() returns null because earlier the request was initialized with null for the currentUri. maybe somebody can figure out what i did wrong:
As far as i understand the token request object is created per http-request and currentUri is initialized with #request.getAttribute('currentUri')}
<bean id="accessTokenProvider" class="org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeAccessTokenProvider"/>
<oauth:resource id="facebookResource" type="authorization_code" client-id="..."
client-secret="..." authentication-scheme="query" access-token-uri="https://graph.facebook.com/oauth/access_token"
user-authorization-uri="https://www.facebook.com/dialog/oauth" token-name="access_token" client-authentication-scheme="form" use-current-uri="true"/>
<oauth:rest-template id="facebookTemplate" resource="facebookResource" access-token-provider="accessTokenProvider" />
still the set method is called with null.