Change implementation for adding user realm to username in password recovery flow. #803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
The current implementation does not add the user realm to the username before the initial user search is conducted through MultiAttributeLoginService. It also does not check if the user realm is not passed at all. This could result in appending user realm as null to the username, which results in a failed search. Additionally if the "PRIMARY" is passed as the realm name in the request wrongly, this implementation still searches through all the user stores and finds the user in a different userstore since UserCoreUtil.addDomainToName function skips adding domain name if it's "PRIMARY". This PR fixes all mentioned issues above.
Related Issues
Dependent PR