-
Notifications
You must be signed in to change notification settings - Fork 841
Open
Description
line 112,
if idTokenWasIssuedByTheUaa, then isAddNewShadowUser will throw a ClassCastException excption caught by servlet.
it's better to catch this exception and throw a AccountNotPreCreatedException.
as below:
if (userFromDb == null) {
try{
if (!isAddNewShadowUser(origin)) {
throw new AccountNotPreCreatedException("The user account must be pre-created. Please contact your system administrator.");
}
}catch(ClassCastException e){
throw new AccountNotPreCreatedException("The user account must be pre-created. Please contact your system administrator.");
}
publish(new NewUserAuthenticatedEvent(userFromRequest.authorities(List.of())));
try {
userFromDb = userDatabase.retrieveUserByName(userFromRequest.getUsername(), origin);
} catch (UsernameNotFoundException ex) {
throw new BadCredentialsException("Unable to register user in internal UAA store.");
}
}
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Inbox