use of org.neo4j.server.security.enterprise.auth.plugin.api.AuthenticationException in project neo4j by neo4j.
the class LdapGroupHasUsersAuthPlugin method authenticateAndAuthorize.
@Override
public AuthInfo authenticateAndAuthorize(AuthToken authToken) throws AuthenticationException {
try {
String username = authToken.principal();
char[] password = authToken.credentials();
LdapContext ctx = authenticate(username, password);
Set<String> roles = authorize(ctx, username);
return AuthInfo.of(username, roles);
} catch (NamingException e) {
throw new AuthenticationException(e.getMessage());
}
}
Aggregations