Skip to content

Commit 806d548

Browse files
klakeggfernandezpablo85
authored andcommitted
Parameters scope and oauth_callback are needed in the request_token step only.
1 parent 959c093 commit 806d548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/scribe/oauth/OAuth10aServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public OAuth10aServiceImpl(SignatureService signatureService, TimestampService t
5353
public Token getRequestToken()
5454
{
5555
OAuthRequest request = new OAuthRequest(config.getRequestTokenVerb(), config.getRequestTokenEndpoint());
56+
request.addOAuthParameter(OAuthConstants.CALLBACK, config.getCallback());
57+
if(scope != NO_SCOPE) request.addOAuthParameter(OAuthConstants.SCOPE, scope);
5658
addOAuthParams(request, OAuthConstants.EMPTY_TOKEN);
5759
addOAuthHeader(request);
5860
Response response = request.send();
@@ -66,8 +68,6 @@ private void addOAuthParams(OAuthRequest request, Token token)
6668
request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, config.getApiKey());
6769
request.addOAuthParameter(OAuthConstants.SIGN_METHOD, signatureService.getSignatureMethod());
6870
request.addOAuthParameter(OAuthConstants.VERSION, getVersion());
69-
request.addOAuthParameter(OAuthConstants.CALLBACK, config.getCallback());
70-
if(scope != NO_SCOPE) request.addOAuthParameter(OAuthConstants.SCOPE, scope);
7171
request.addOAuthParameter(OAuthConstants.SIGNATURE, getSignature(request, token));
7272
}
7373

0 commit comments

Comments
 (0)