public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException {
logger.debug("username : {}", username);
if (debug) {
SpringSecurityUserAuth userAuth = new SpringSecurityUserAuth();
userAuth.setId("1");
userAuth.setUsername(username);
userAuth.setDisplayName(username);
userAuth.setPermissions(Collections.singletonList("*"));
return userAuth;
}
try {
UserAuthDTO userAuthDto = userAuthConnector.findByUsername(
username, ScopeHolder.getScopeId());
SpringSecurityUserAuth userAuthResult = new SpringSecurityUserAuth();
beanMapper.copy(userAuthDto, userAuthResult);
if (defaultPassword != null) {
userAuthResult.setPassword(defaultPassword);
}
return userAuthResult;
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);