File tree Expand file tree Collapse file tree
scribejava-core/src/main/java/com/github/scribejava/core/oauth Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[SNAPSHOT]
2+ * omit the client_secret parameter if it is an empty string while refreshing token (thanks to https://github.com/KungfuPancake)
23
34[4.1.0]
45 * make client_secret optional in OAuth2 while requesting AccessToken (if set to null, it's not required by OAuth2 specs)
Original file line number Diff line number Diff line change @@ -123,8 +123,9 @@ protected OAuthRequest createRefreshTokenRequest(String refreshToken) {
123123 final OAuthRequest request = new OAuthRequest (api .getAccessTokenVerb (), api .getRefreshTokenEndpoint ());
124124 final OAuthConfig config = getConfig ();
125125 request .addParameter (OAuthConstants .CLIENT_ID , config .getApiKey ());
126- if (config .getApiSecret () != null ) {
127- request .addParameter (OAuthConstants .CLIENT_SECRET , config .getApiSecret ());
126+ final String apiSecret = config .getApiSecret ();
127+ if (apiSecret != null ) {
128+ request .addParameter (OAuthConstants .CLIENT_SECRET , apiSecret );
128129 }
129130 request .addParameter (OAuthConstants .REFRESH_TOKEN , refreshToken );
130131 request .addParameter (OAuthConstants .GRANT_TYPE , OAuthConstants .REFRESH_TOKEN );
You can’t perform that action at this time.
0 commit comments