From 806d548629193eecac15c32ba27c6d897287d11e Mon Sep 17 00:00:00 2001 From: klakegg Date: Wed, 24 Nov 2010 17:55:53 +0800 Subject: [PATCH] Parameters scope and oauth_callback are needed in the request_token step only. --- src/main/java/org/scribe/oauth/OAuth10aServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/scribe/oauth/OAuth10aServiceImpl.java b/src/main/java/org/scribe/oauth/OAuth10aServiceImpl.java index ccb1717..296d725 100644 --- a/src/main/java/org/scribe/oauth/OAuth10aServiceImpl.java +++ b/src/main/java/org/scribe/oauth/OAuth10aServiceImpl.java @@ -53,6 +53,8 @@ public class OAuth10aServiceImpl implements OAuthService public Token getRequestToken() { OAuthRequest request = new OAuthRequest(config.getRequestTokenVerb(), config.getRequestTokenEndpoint()); + request.addOAuthParameter(OAuthConstants.CALLBACK, config.getCallback()); + if(scope != NO_SCOPE) request.addOAuthParameter(OAuthConstants.SCOPE, scope); addOAuthParams(request, OAuthConstants.EMPTY_TOKEN); addOAuthHeader(request); Response response = request.send(); @@ -66,8 +68,6 @@ public class OAuth10aServiceImpl implements OAuthService request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, config.getApiKey()); request.addOAuthParameter(OAuthConstants.SIGN_METHOD, signatureService.getSignatureMethod()); request.addOAuthParameter(OAuthConstants.VERSION, getVersion()); - request.addOAuthParameter(OAuthConstants.CALLBACK, config.getCallback()); - if(scope != NO_SCOPE) request.addOAuthParameter(OAuthConstants.SCOPE, scope); request.addOAuthParameter(OAuthConstants.SIGNATURE, getSignature(request, token)); }