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

Fix Multi Attribute Username Resolving Issue for resend-code #792

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

dhaura
Copy link
Contributor

@dhaura dhaura commented Dec 15, 2023

Purpose

  • This PR fixes the multi attribute username resolving issue for resend-code by getting the preferred username (which doesn't include user store name with the username) instead of username.

Related Issues

@@ -64,7 +68,7 @@ public Response resendCodePost(ResendCodeRequestDTO resendCodeRequestDTO) {
ResolvedUserResult resolvedUserResult = FrameworkUtils.processMultiAttributeLoginIdentification(
resendCodeRequestDTO.getUser().getUsername(), resendCodeRequestDTO.getUser().getTenantDomain());
if (ResolvedUserResult.UserResolvedStatus.SUCCESS.equals(resolvedUserResult.getResolvedStatus())) {
resendCodeRequestDTO.getUser().setUsername(resolvedUserResult.getUser().getUsername());
resendCodeRequestDTO.getUser().setUsername(resolvedUserResult.getUser().getPreferredUsername());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can u check whether password recovery[1] API also affected with the same issue
[1]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There is NO issue in password recovery API since it needs the username in the format <USER_STORE>/<USERNAME> for secondary user store users unlike in resend code.

  • Tested with Primary and Secondary user store users and the flows are working as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analysis

  • For resende-code flow, the username is stored in the format of <USERNAME> in IDN_RECOVERY_DATA table but for password-recovery flow, the username is stored in the format of <USER_STORE>/<USERNAME> (only for secondary user stores) as follows.
Screenshot 2023-12-15 at 12 42 01

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline let's create a git issue to track this inconsistencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/7284627735

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/7284627735
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/7284627735

@nilasini nilasini merged commit fe0a4b2 into wso2-extensions:master Dec 21, 2023
3 checks passed
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.

4 participants