Skip to content

Commit 7649336

Browse files
authored
RFC conform handling for grant_type=refresh_token without code
in case of grant_type=refresh_token there is no code spaces to tabs formating corrected
1 parent 3780e50 commit 7649336

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/main/java/com/docusign/esign/client/auth/OAuthJerseyClient.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@ public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map
4949
code = value;
5050
} else if ("client_id".equals(key)) {
5151
clientId = value;
52-
} else if ("client_secret".equals(key)) {
53-
clientSecret = value;
54-
}
55-
}
52+
} else if ("client_secret".equals(key)) {
53+
clientSecret = value;
54+
}
55+
}
5656

57-
if (grantType == null) {
58-
throw new OAuthSystemException("Missing grant_type");
59-
}
60-
if (!grantType.equals(GrantType.REFRESH_TOKEN.toString()) && code == null) {
61-
throw new OAuthSystemException("Missing code for grant_type="+grantType);
62-
}
57+
if (grantType == null) {
58+
throw new OAuthSystemException("Missing grant_type");
59+
}
60+
if (!grantType.equals(GrantType.REFRESH_TOKEN.toString()) && code == null) {
61+
throw new OAuthSystemException("Missing code for grant_type="+grantType);
62+
}
6363

64-
if (code == null) {
65-
body = "grant_type=" + grantType;
66-
} else {
67-
body = "grant_type=" + grantType + "&code=" + code;
68-
}
64+
if (code == null) {
65+
body = "grant_type=" + grantType;
66+
} else {
67+
body = "grant_type=" + grantType + "&code=" + code;
68+
}
6969

70-
if (clientId == null || clientSecret == null) {
70+
if (clientId == null || clientSecret == null) {
7171
throw new OAuthSystemException("Missing clientId/secret");
7272
} else {
7373
byte[] bytes = (clientId + ":" + clientSecret).getBytes();

0 commit comments

Comments
 (0)