-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always use the PRIMARY userstore to add local claims in Asgardeo #440
base: master
Are you sure you want to change the base?
Conversation
Make sure that the PRIMARY store is beign used to add the local claims in Asgardeo.
@@ -969,6 +969,13 @@ private void validateAttributeMappings(List<AttributeMappingDTO> attributeMappin | |||
throw handleClaimManagementClientError(ERROR_CODE_EMPTY_MAPPED_ATTRIBUTES_IN_LOCAL_CLAIM, | |||
BAD_REQUEST, attributeMappingDTO.getUserstore()); | |||
} | |||
if (IdentityUtil.getHostName().contains("asgardeo.io") || IdentityUtil.getHostName().contains("asg.io")) { | |||
if (!primaryUserstoreDomainName.equalsIgnoreCase(attributeMappingDTO.getUserstore())) { | |||
throw handleClaimManagementClientError(ERROR_CODE_INVALID_USERSTORE.getCode(), "You can only use" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to throw this exception only if the host names are asgardeo.io and asg.io? We can't use any other userstore name even if we use a different domain right? (As the Asgardeo userstore is named as primary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I needed to check whether this is on-prem or Asgardeo and if it's Asgardeo not allowed to use any other userstores. That's why I used this logic
...2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java
Outdated
Show resolved
Hide resolved
Use `ClaimManagement.BindToPrimaryUserStore` to check whether we should use only the primary userstore to add local claims
Purpose