Skip to content

Commit

Permalink
Add meaningful variable names.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmadhavig committed Aug 15, 2024
1 parent 6e4bba9 commit fc19a14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public Boolean getOmitUsernameInIntrospectionRespForAppTokens() {
public void setOmitUsernameInIntrospectionRespForAppTokens(Boolean omitUsernameInIntrospectionRespForAppTokens) {

this.omitUsernameInIntrospectionRespForAppTokens = omitUsernameInIntrospectionRespForAppTokens;
}

public String getExtAllowedAudience() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ private OAuth2IntrospectionResponseDTO validateAccessToken(OAuth2TokenValidation
}

String tokenType = accessTokenDO.getTokenType();
boolean removeUsernameFromAppTokenEnabled = OAuthServerConfiguration.getInstance()
boolean removeUsernameFromAppTokenEnabledServerConfig = OAuthServerConfiguration.getInstance()
.isRemoveUsernameFromIntrospectionResponseForAppTokensEnabled();
boolean isAppTokenType = StringUtils.equals(OAuthConstants.UserType.APPLICATION, tokenType);
boolean omitUsernameInIntrospectionRespForAppTokens =
boolean removeUsernameFromAppTokenEnabledAppConfig =
isOmitUsernameInIntrospectionRespForAppTokens(accessTokenDO, tenantDomain);

// should be in seconds
Expand All @@ -584,7 +584,7 @@ private OAuth2IntrospectionResponseDTO validateAccessToken(OAuth2TokenValidation
// token scopes
introResp.setScope(OAuth2Util.buildScopeString((accessTokenDO.getScope())));
// set user-name
if (!(removeUsernameFromAppTokenEnabled && omitUsernameInIntrospectionRespForAppTokens)
if (!(removeUsernameFromAppTokenEnabledServerConfig && removeUsernameFromAppTokenEnabledAppConfig)
|| !isAppTokenType) {
introResp.setUsername(getAuthzUser(accessTokenDO));
}
Expand Down

0 comments on commit fc19a14

Please sign in to comment.