Fix the case when user is directly deleted in LDAP server
This commit is contained in:
parent
c8c4cfbaae
commit
0d00db281a
1 changed files with 3 additions and 0 deletions
|
@ -211,6 +211,9 @@ public class AuthenticationProviderManager {
|
|||
private void checkCorrectAuthLink(AuthenticationProvider authProvider, AuthenticationProviderModel providerModel,
|
||||
AuthenticationLinkModel authLinkModel, String username) throws AuthenticationProviderException {
|
||||
AuthUser authUser = authProvider.getUser(realm, providerModel.getConfig(), username);
|
||||
if (authUser == null) {
|
||||
throw new AuthenticationProviderException("User " + username + " not found in authentication provider " + providerModel.getProviderName());
|
||||
}
|
||||
String userExternalId = authUser.getId();
|
||||
if (!userExternalId.equals(authLinkModel.getAuthUserId())) {
|
||||
throw new AuthenticationProviderException("ID did not match! ID from provider: " + userExternalId + ", ID from authentication link: " + authLinkModel.getAuthUserId());
|
||||
|
|
Loading…
Reference in a new issue