| | |
| | | String realm = settings.getString(Keys.realm.userService, "${baseFolder}/users.conf"); |
| | | if (legacyRedirects.containsKey(realm)) { |
| | | logger.warn(""); |
| | | logger.warn("#################################################################"); |
| | | logger.warn(Constants.BORDER2); |
| | | logger.warn(" IUserService '{}' is obsolete!", realm); |
| | | logger.warn(" Please set '{}={}'", "realm.authenticationProviders", legacyRedirects.get(realm)); |
| | | logger.warn("#################################################################"); |
| | | logger.warn(Constants.BORDER2); |
| | | logger.warn(""); |
| | | |
| | | // conditionally override specified authentication providers |
| | |
| | | if (principal != null) { |
| | | String username = principal.getName(); |
| | | if (!StringUtils.isEmpty(username)) { |
| | | boolean internalAccount = isInternalAccount(username); |
| | | boolean internalAccount = userManager.isInternalAccount(username); |
| | | UserModel user = userManager.getUserModel(username); |
| | | if (user != null) { |
| | | // existing user |
| | |
| | | // can not authenticate empty password |
| | | return null; |
| | | } |
| | | // check to see if this is the federation user |
| | | // if (canFederate()) { |
| | | // if (usernameDecoded.equalsIgnoreCase(Constants.FEDERATION_USER)) { |
| | | // List<String> tokens = getFederationTokens(); |
| | | // if (tokens.contains(pw)) { |
| | | // return getFederationUser(); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | UserModel user = userManager.getUserModel(usernameDecoded); |
| | | |
| | | // try local authentication |
| | | UserModel user = userManager.getUserModel(usernameDecoded); |
| | | if (user != null) { |
| | | if (user != null && user.isLocalAccount()) { |
| | | UserModel returnedUser = null; |
| | | if (user.password.startsWith(StringUtils.MD5_TYPE)) { |
| | | // password digest |
| | |
| | | } |
| | | return AuthenticationProvider.NULL_PROVIDER; |
| | | } |
| | | |
| | | /** |
| | | * Returns true if the username represents an internal account |
| | | * |
| | | * @param username |
| | | * @return true if the specified username represents an internal account |
| | | */ |
| | | protected boolean isInternalAccount(String username) { |
| | | return !StringUtils.isEmpty(username) |
| | | && (username.equalsIgnoreCase(Constants.FEDERATION_USER) |
| | | || username.equalsIgnoreCase(UserModel.ANONYMOUS.username)); |
| | | } |
| | | |
| | | // protected UserModel getFederationUser() { |
| | | // // the federation user is an administrator |
| | | // UserModel federationUser = new UserModel(Constants.FEDERATION_USER); |
| | | // federationUser.canAdmin = true; |
| | | // return federationUser; |
| | | // } |
| | | } |