}
if (authUser == null) {
if (this.unknownUserHandler != null) {
// Check whether the user should be added
NewUserInfo newUserInfo = this.unknownUserHandler.handleUser(username);
if (newUserInfo != null) {
if (!noDbConn) {
// Create the user on the DB
authUser = this.authenticationEditorModel.addUser(username, newUserInfo.getPassword(), newUserInfo.getAuthorities());
} else {
// No DB connectivity, so just return user as defined by UnknownUserHandler
newUserInfo.getAuthorities();
List<GrantedAuthority> grantedAuths = new ArrayList<>();
for (String role : newUserInfo.getAuthorities()) {
grantedAuths.add(new SimpleGrantedAuthority(role));
}
return new User(username, newUserInfo.getPassword(), grantedAuths);
}
}
}
if (authUser == null) {