Announcement Announcement Module
No announcement yet.
Token request with current uri fails because current uri is null Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Token request with current uri fails because current uri is null

    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:

    	<bean id="accessTokenProvider" class=""/>
    	<oauth:resource id="facebookResource" type="authorization_code" client-id="..."
    		client-secret="..." authentication-scheme="query" access-token-uri=""
    		user-authorization-uri="" token-name="access_token" client-authentication-scheme="form" use-current-uri="true"/>
    	<oauth:rest-template id="facebookTemplate" resource="facebookResource" access-token-provider="accessTokenProvider" />
    As far as i understand the token request object is created per http-request and currentUri is initialized with #request.getAttribute('currentUri')}
    still the set method is called with null.


  • #2
    Hard to see how it could be null unless you don't have the OAuth2ClientContextFilter. You do have <oauth:client/> defined and an entry in your filter chain, right?

    P.S. RC is over now. Use the 1.0.0.RELEASE please.


    • #3
      without having the project at hand right now.... no, i don't think so.

      PS: i will update on monday, i just found out about the release today.