Results 1 to 3 of 3

Thread: Token request with current uri fails because current uri is null

  1. #1
    Join Date
    Apr 2012
    Posts
    19

    Default 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:


    Code:
    	<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" />
    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.

    Greetings,
    Alexander

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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. #3
    Join Date
    Apr 2012
    Posts
    19

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •