Skip to content

Commit

Permalink
#566 (4.0.0): code clean up
Browse files Browse the repository at this point in the history
#566

(cherry picked from commit 9a41664)
  • Loading branch information
yuriyz committed Nov 5, 2018
1 parent 0cb87fb commit eb61685
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,14 @@ private AuthorizationGrant getAuthorizationGrant(String authorization, String ac
String clientId = URLDecoder.decode(token.substring(0, delim), Util.UTF8_STRING_ENCODING);
String password = URLDecoder.decode(token.substring(delim + 1), Util.UTF8_STRING_ENCODING);
if (clientService.authenticate(clientId, password)) {
final AuthorizationGrant grantOfIntrospectionToken = authorizationGrantList.getAuthorizationGrantByAccessToken(accessToken);
if (grantOfIntrospectionToken != null) {
if (!grantOfIntrospectionToken.getClientId().equals(clientId)) {
log.trace("Failed to match grant object clientId and client id provided during authentication.");
return null;
}
return grantOfIntrospectionToken;
grant = authorizationGrantList.getAuthorizationGrantByAccessToken(accessToken);
if (grant != null && !grant.getClientId().equals(clientId)) {
log.trace("Failed to match grant object clientId and client id provided during authentication.");
return null;
}
} else {
log.trace("Failed to perform basic authentication for client: " + clientId);
}

}
}
return grant;
Expand Down

0 comments on commit eb61685

Please sign in to comment.