Skip to content

Commit

Permalink
Accepting both CustomerCareOfficer and CustomerCareOfficerRole
Browse files Browse the repository at this point in the history
  • Loading branch information
anjuchamantha committed Nov 11, 2024
1 parent 9d5ca7d commit b48185d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public class RoleClaimProviderImpl implements ClaimProvider {
private static final String USER_ROLE = "user_role";
private static final String OPENID_SCOPE = "openid";
private static final String CUSTOMER_CARE_OFFICER = "customerCareOfficer";
private static final String CUSTOMER_CARE_OFFICER_ROLE = "Internal/CustomerCareOfficerRole";
private static final String INTERNAL_CUSTOMER_CARE_OFFICER_ROLE = "Internal/CustomerCareOfficerRole";
private static final String INTERNAL_CUSTOMER_CARE_OFFICER = "Internal/CustomerCareOfficer";
private static final String CUSTOMER_CARE_OFFICER_SCOPE = "consents:read_all";

@Generated(message = "Do not contain logics")
Expand Down Expand Up @@ -86,7 +87,8 @@ public Map<String, Object> getAdditionalClaims(OAuthTokenReqMessageContext oAuth
UserStoreManager userStoreManager = realmService.getTenantUserRealm(tenantId).getUserStoreManager();

String[] roles = userStoreManager.getRoleListOfUser(userId);
if (ArrayUtils.contains(roles, CUSTOMER_CARE_OFFICER_ROLE)) {
if (ArrayUtils.contains(roles, INTERNAL_CUSTOMER_CARE_OFFICER_ROLE) || ArrayUtils.contains(roles,
INTERNAL_CUSTOMER_CARE_OFFICER)) {
claims.put(USER_ROLE, CUSTOMER_CARE_OFFICER);
}
} catch (IdentityRuntimeException e) {
Expand Down

0 comments on commit b48185d

Please sign in to comment.