Skip to content

Commit

Permalink
Fix dcr name update
Browse files Browse the repository at this point in the history
  • Loading branch information
JeethJJ committed Jan 8, 2025
1 parent 89c8817 commit 2172cda
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,13 @@ public Application updateApplication(ApplicationUpdateRequest updateRequest, Str
}
// Todo: validate version input. Create a function at app mgt.
sp.setApplicationVersion(applicationVersion);
if (StringUtils.isNotEmpty(updateRequest.getExtAllowedAudience()) &&
(updateRequest.getExtAllowedAudience().equalsIgnoreCase(ORG_ROLE_AUDIENCE)
|| updateRequest.getExtAllowedAudience().equalsIgnoreCase(APP_ROLE_AUDIENCE))) {
AssociatedRolesConfig associatedRolesConfig = new AssociatedRolesConfig();
associatedRolesConfig.setAllowedAudience(updateRequest.getExtAllowedAudience().toLowerCase());
sp.setAssociatedRolesConfig(associatedRolesConfig);
}
// Need to create a deep clone, since modifying the fields of the original object,
// will modify the cached SP object.
ServiceProvider clonedSP = cloneServiceProvider(sp);
Expand Down Expand Up @@ -414,14 +421,6 @@ public Application updateApplication(ApplicationUpdateRequest updateRequest, Str
appDTO.setBypassClientCredentials(updateRequest.isExtPublicClient());
oAuthAdminService.updateConsumerApplication(appDTO);

if (StringUtils.isNotEmpty(updateRequest.getExtAllowedAudience()) &&
(updateRequest.getExtAllowedAudience().equalsIgnoreCase(ORG_ROLE_AUDIENCE)
|| updateRequest.getExtAllowedAudience().equalsIgnoreCase(APP_ROLE_AUDIENCE))) {
AssociatedRolesConfig associatedRolesConfig = new AssociatedRolesConfig();
associatedRolesConfig.setAllowedAudience(updateRequest.getExtAllowedAudience().toLowerCase());
sp.setAssociatedRolesConfig(associatedRolesConfig);
updateServiceProvider(sp, tenantDomain, applicationOwner);
}
} catch (IdentityOAuthClientException e) {
throw new DCRMClientException(DCRMConstants.ErrorCodes.INVALID_CLIENT_METADATA, e.getMessage(), e);
} catch (IdentityOAuthAdminException e) {
Expand Down

0 comments on commit 2172cda

Please sign in to comment.