Skip to content
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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sahandilshan
Copy link
Contributor

@sahandilshan sahandilshan commented Apr 6, 2023

Purpose

  • Make sure that the PRIMARY store is beign used to add the local claims in Asgardeo.

Make sure that the PRIMARY store is beign used to add the local claims in Asgardeo.
@sahandilshan sahandilshan marked this pull request as ready for review April 7, 2023 08:49
@@ -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"
Copy link
Contributor

@DMHP DMHP Apr 11, 2023

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)

Copy link
Contributor Author

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

Use `ClaimManagement.BindToPrimaryUserStore` to check whether we should use only the primary userstore to add local claims
@sahandilshan sahandilshan marked this pull request as draft May 15, 2023 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants