rbeckman-nextgen / test-mc3

0 stars 0 forks source link

Error in handleSecondaryAuthentication - DefaultUserController #4335

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

When using a AuthorizationPlugin, you should be allowed to login using a 'linked' username.

For example: mirth username: 'mirth' - authorizationplugin username: 'autho' When login in you can use autho, the authorizationplugin changes that to 'mirth' by using the updatedUsername property in LoginStatus.

After authorization, the handleSecondaryAuthentication method is called. In this the strikecount get's reset, but when using 'autho' it doesn't find the user.

DefaultUserController: line 627: loginRequirementsChecker = new LoginRequirementsChecker(getUser(null, username));

should be changed to:

                loginRequirementsChecker = new LoginRequirementsChecker(getUser(null, StringUtils.defaultString(loginStatus.getUpdatedUsername(), username)));

When doing this, the updateUsername is used

Imported Issue. Original Details: Jira Issue Key: MIRTH-4480 Reporter: v3nn3tj3 Created: 2020-01-29T17:11:47.000-0800