Skip to content

Commit

Permalink
Use camelCase
Browse files Browse the repository at this point in the history
Signed-off-by: aram price <aprice@pivotal.io>
  • Loading branch information
jhamon authored and Pivotal committed Aug 1, 2018
1 parent 63fabda commit 328b66b
Showing 1 changed file with 7 additions and 7 deletions.
Expand Up @@ -191,15 +191,15 @@ public OAuth2AccessToken refreshAccessToken(String refreshTokenValue, TokenReque
throw new InvalidGrantException("Wrong client for this refresh token: " + clientId); throw new InvalidGrantException("Wrong client for this refresh token: " + clientId);
} }


String userid = (String) refreshTokenClaims.get(USER_ID); String userId = (String) refreshTokenClaims.get(USER_ID);
String refreshTokenId = (String) refreshTokenClaims.get(JTI); String refreshTokenId = (String) refreshTokenClaims.get(JTI);
String accessTokenId = generateUniqueTokenId(); String accessTokenId = generateUniqueTokenId();


boolean opaque = TokenConstants.OPAQUE.equals(request.getRequestParameters().get(TokenConstants.REQUEST_TOKEN_FORMAT)); boolean opaque = TokenConstants.OPAQUE.equals(request.getRequestParameters().get(TokenConstants.REQUEST_TOKEN_FORMAT));
Boolean revocableClaim = (Boolean)refreshTokenClaims.get(REVOCABLE); Boolean revocableClaim = (Boolean)refreshTokenClaims.get(REVOCABLE);
boolean revocable = opaque || (revocableClaim == null ? false : revocableClaim); boolean revocable = opaque || (revocableClaim == null ? false : revocableClaim);


UaaUser user = userDatabase.retrieveUserById(userid); UaaUser user = userDatabase.retrieveUserById(userId);
ClientDetails client = clientDetailsService.loadClientByClientId(clientId, IdentityZoneHolder.get().getId()); ClientDetails client = clientDetailsService.loadClientByClientId(clientId, IdentityZoneHolder.get().getId());


Integer refreshTokenExpiry = (Integer) refreshTokenClaims.get(EXP); Integer refreshTokenExpiry = (Integer) refreshTokenClaims.get(EXP);
Expand Down Expand Up @@ -227,7 +227,7 @@ public OAuth2AccessToken refreshAccessToken(String refreshTokenValue, TokenReque
// ensure all requested scopes are approved: either automatically or // ensure all requested scopes are approved: either automatically or
// explicitly by the user // explicitly by the user
String grantType = refreshTokenClaims.get(GRANT_TYPE).toString(); String grantType = refreshTokenClaims.get(GRANT_TYPE).toString();
checkForApproval(userid, clientId, requestedScopes, checkForApproval(userId, clientId, requestedScopes,
getAutoApprovedScopes(grantType, tokenScopes, client) getAutoApprovedScopes(grantType, tokenScopes, client)
); );


Expand Down Expand Up @@ -262,8 +262,8 @@ public OAuth2AccessToken refreshAccessToken(String refreshTokenValue, TokenReque
authenticationMethodsAsSet(refreshTokenClaims), authenticationMethodsAsSet(refreshTokenClaims),
null, null,
requestedScopes, requestedScopes,
rolesAsSet(userid), rolesAsSet(userId),
getUserAttributes(userid), getUserAttributes(userId),
nonce, nonce,
grantType, grantType,
generateUniqueTokenId()); generateUniqueTokenId());
Expand Down Expand Up @@ -317,7 +317,7 @@ private HashSet<String> authenticationMethodsAsSet(Map<String, Object> refreshTo
return authenticationMethods == null ? Sets.newHashSet() : Sets.newHashSet(authenticationMethods); return authenticationMethods == null ? Sets.newHashSet() : Sets.newHashSet(authenticationMethods);
} }


private void checkForApproval(String userid, private void checkForApproval(String userId,
String clientId, String clientId,
Collection<String> requestedScopes, Collection<String> requestedScopes,
Collection<String> autoApprovedScopes) { Collection<String> autoApprovedScopes) {
Expand All @@ -328,7 +328,7 @@ private void checkForApproval(String userid,
// auto approved, not expired, // auto approved, not expired,
// not DENIED and not approved more recently than when this access token // not DENIED and not approved more recently than when this access token
// was issued. // was issued.
List<Approval> approvals = approvalStore.getApprovals(userid, clientId, IdentityZoneHolder.get().getId()); List<Approval> approvals = approvalStore.getApprovals(userId, clientId, IdentityZoneHolder.get().getId());
for (Approval approval : approvals) { for (Approval approval : approvals) {
if (requestedScopes.contains(approval.getScope()) && approval.getStatus() == ApprovalStatus.APPROVED) { if (requestedScopes.contains(approval.getScope()) && approval.getStatus() == ApprovalStatus.APPROVED) {
if (!approval.isCurrentlyActive()) { if (!approval.isCurrentlyActive()) {
Expand Down

0 comments on commit 328b66b

Please sign in to comment.