Skip to content

Commit

Permalink
Addressing the review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
indeewari committed Jan 26, 2025
1 parent 51e8a4a commit 3d61b76
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ public OAuth2AccessTokenRespDTO issue(OAuthTokenReqMessageContext tokReqMsgCtx)

String requestGrantType = tokReqMsgCtx.getOauth2AccessTokenReqDTO().getGrantType();
boolean isConsentRequiredGrant = OIDCClaimUtil.isConsentBasedClaimFilteringApplicable(requestGrantType);
boolean isRichAuthRequest = AuthorizationDetailsUtils.isRichAuthorizationRequest(
tokReqMsgCtx.getAuthorizationDetails());

if (!isConsentRequiredGrant) {
if (!isConsentRequiredGrant && !isRichAuthRequest) {

long expireTime = getAccessTokenExpiryTimeMillis(existingTokenBean);
if (isExistingTokenValid(existingTokenBean, expireTime)) {
Expand Down Expand Up @@ -244,6 +246,15 @@ If the application does not have a token binding type (i.e., no specific binding
log.debug("Latest access token is found in the OAuthCache for the app: " + consumerKey);
}

if (accessTokenRenewedPerRequest(oauthTokenIssuer, tokReqMsgCtx)) {
if (log.isDebugEnabled()) {
log.debug("TokenRenewalPerRequest is enabled. " +
"Proceeding to revoke any existing active tokens and issue new token for client Id: " +
consumerKey + ", user: " + authorizedUserId + " and scope: " + scope + ".");
}
return renewAccessToken(tokReqMsgCtx, scope, consumerKey, existingTokenBean, oauthTokenIssuer);
}

long expireTime = getAccessTokenExpiryTimeMillis(existingTokenBean);
if (isExistingTokenValid(existingTokenBean, expireTime)) {
if (log.isDebugEnabled()) {
Expand Down

0 comments on commit 3d61b76

Please sign in to comment.