Skip to content

Commit b4fb7f8

Browse files
tlxtellefkullfar
authored andcommitted
Fixed missing support for scope for refresh_token grant. https://tools.ietf.org/html/rfc6749#section-6
1 parent dc54b59 commit b4fb7f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scribejava-core/src/main/java/com/github/scribejava/core/oauth/OAuth20Service.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,14 @@ protected OAuthRequest createRefreshTokenRequest(String refreshToken) {
148148
throw new IllegalArgumentException("The refreshToken cannot be null or empty");
149149
}
150150
final OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getRefreshTokenEndpoint());
151+
final OAuthConfig config = getConfig();
151152

152-
api.getClientAuthenticationType().addClientAuthentication(request, getConfig());
153+
api.getClientAuthenticationType().addClientAuthentication(request, config);
154+
155+
final String scope = config.getScope();
156+
if (scope != null) {
157+
request.addParameter(OAuthConstants.SCOPE, scope);
158+
}
153159

154160
request.addParameter(OAuthConstants.REFRESH_TOKEN, refreshToken);
155161
request.addParameter(OAuthConstants.GRANT_TYPE, OAuthConstants.REFRESH_TOKEN);

0 commit comments

Comments
 (0)