Skip to content

Commit

Permalink
Modifying the logic order
Browse files Browse the repository at this point in the history
  • Loading branch information
indeewari committed Jan 7, 2025
1 parent 6bae6d9 commit 5606e85
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,6 @@ public OAuth2AccessTokenRespDTO issue(OAuthTokenReqMessageContext tokReqMsgCtx)
OAuthAppDO oAuthAppDO = (OAuthAppDO) tokReqMsgCtx.getProperty(OAUTH_APP);
String tokenType = oauthTokenIssuer.getAccessTokenType();

if (isHashDisabled) {
existingTokenBean = getExistingToken(tokReqMsgCtx,
getOAuthCacheKey(scope, consumerKey, authorizedUserId, authenticatedIDP,
tokenBindingReference, authorizedOrganization));
}

/*
This segment handles access token requests that neither require generating a new token
nor renewing an existing one. Instead, it returns the existing token if it is still valid.
Expand All @@ -193,6 +187,12 @@ public OAuth2AccessTokenRespDTO issue(OAuthTokenReqMessageContext tokReqMsgCtx)
OAuth2ServiceComponentHolder.getJwtRenewWithoutRevokeAllowedGrantTypes()
.contains(tokReqMsgCtx.getOauth2AccessTokenReqDTO().getGrantType()))) {

if (isHashDisabled) {
existingTokenBean = getExistingToken(tokReqMsgCtx,
getOAuthCacheKey(scope, consumerKey, authorizedUserId, authenticatedIDP,
tokenBindingReference, authorizedOrganization));
}

if (existingTokenBean != null && !accessTokenRenewedPerRequest(oauthTokenIssuer, tokReqMsgCtx)) {

String requestGrantType = tokReqMsgCtx.getOauth2AccessTokenReqDTO().getGrantType();
Expand Down

0 comments on commit 5606e85

Please sign in to comment.