Skip to content

Commit

Permalink
Check server config, before applying default behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmadhavig committed Aug 21, 2024
1 parent 654f5f3 commit 0db749d
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,21 +437,33 @@ OAuthConsumerAppDTO registerAndRetrieveOAuthApplicationData(OAuthConsumerAppDTO
application.isTokenRevocationWithIDPSessionTerminationEnabled());
/* If the value is not sent at the request, set the default value for new apps, this ensures
for new apps, the USE_CLIENT_ID_AS_SUB_CLAIM_FOR_APP_TOKENS property is never null. */
boolean useClientIdAsSubClaimForAppTokensEnabledServerConfig = OAuthServerConfiguration
.getInstance().isUseClientIdAsSubClaimForAppTokensEnabled();
if (application.isUseClientIdAsSubClaimForAppTokens() != null) {
app.setUseClientIdAsSubClaimForAppTokens(application.isUseClientIdAsSubClaimForAppTokens());
} else {
} else if (useClientIdAsSubClaimForAppTokensEnabledServerConfig) {
app.setUseClientIdAsSubClaimForAppTokens(
USE_CLIENT_ID_AS_SUB_CLAIM_FOR_APP_TOKENS_NEW_APP_DEFAULT_VALUE);
} else {
app.setUseClientIdAsSubClaimForAppTokens(
!USE_CLIENT_ID_AS_SUB_CLAIM_FOR_APP_TOKENS_NEW_APP_DEFAULT_VALUE);
}

/* If the value is not sent at the request, set the default value for new apps, this ensures
for new apps, the OMIT_USERNAME_IN_INTROSPECTION_RESP_FOR_APP_TOKEN property is never null. */
boolean removeUsernameFromAppTokenEnabledServerConfig = OAuthServerConfiguration.getInstance()
.isRemoveUsernameFromIntrospectionResponseForAppTokensEnabled();
if (application.isOmitUsernameInIntrospectionRespForAppTokens() != null) {
app.setOmitUsernameInIntrospectionRespForAppTokens(
application.isOmitUsernameInIntrospectionRespForAppTokens());
} else {
} else if (removeUsernameFromAppTokenEnabledServerConfig) {
app.setOmitUsernameInIntrospectionRespForAppTokens(
OMIT_USERNAME_IN_INTROSPECTION_RESP_FOR_APP_TOKEN_NEW_APP_DEFAULT_VALUE);
} else {
app.setOmitUsernameInIntrospectionRespForAppTokens(
!OMIT_USERNAME_IN_INTROSPECTION_RESP_FOR_APP_TOKEN_NEW_APP_DEFAULT_VALUE);
}

String tokenEndpointAuthMethod = application.getTokenEndpointAuthMethod();
if (StringUtils.isNotEmpty(tokenEndpointAuthMethod)) {
if (isFAPIConformanceEnabled) {
Expand Down

0 comments on commit 0db749d

Please sign in to comment.