Class LDAPIdentityResolver
- All Implemented Interfaces:
IdentityResolver<LDAPAuthentication,
LDAPIdentity>
LDAP identity resolver used to resolve the identity of an authenticated user from an LDAP server.
It searches user entries in an LDAP server based on the DN and uid provided by the LDAP authentication. The attributes to retrieve can be specified and the resulting LDAPIdentity
shall only
contains these ones. By default it resolves: uid, sn, cn, grivenName, displayName, mail, title, telephoneNumber, mobile and jpegPhoto.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLDAPIdentityResolver
(LDAPClient ldapClient) Creates an LDAP identity resolver.LDAPIdentityResolver
(LDAPClient ldapClient, String searchUserFilter) Creates an LDAP identity resolver with the specified search user filter.LDAPIdentityResolver
(LDAPClient ldapClient, String... attributes) Creates an LDAP identity resolver that resolves the specified attributes.LDAPIdentityResolver
(LDAPClient ldapClient, String searchUserFilter, String... attributes) Creates an LDAP identity resolver with the specified search user filter that resolves the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionString[]
Returns the attributes resolved by the resolver.Returns the search user filter.resolveIdentity
(LDAPAuthentication authentication) Resolves the identity of the authenticated entity from the specified authentication.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.security.identity.IdentityResolver
flatMap, map
-
Field Details
-
DEFAULT_SEARCH_USER_FILTER
The default search user filter.- See Also:
-
DEFAULT_SEARCH_ATTRIBUTES
The default attributes to resolve.
-
-
Constructor Details
-
LDAPIdentityResolver
Creates an LDAP identity resolver.
- Parameters:
ldapClient
- the LDAP client
-
LDAPIdentityResolver
Creates an LDAP identity resolver that resolves the specified attributes.
- Parameters:
ldapClient
- the LDAP clientattributes
- the attributes to resolve
-
LDAPIdentityResolver
Creates an LDAP identity resolver with the specified search user filter.
- Parameters:
ldapClient
- the LDAP clientsearchUserFilter
- a filter
-
LDAPIdentityResolver
Creates an LDAP identity resolver with the specified search user filter that resolves the specified attributes.
- Parameters:
ldapClient
- the LDAP clientsearchUserFilter
- a filterattributes
- the attributes to resolve
-
-
Method Details
-
getAttributes
Returns the attributes resolved by the resolver.
- Returns:
- the attributes to resolve
-
getSearchUserFilter
Returns the search user filter.
- Returns:
- a filter
-
resolveIdentity
public Mono<LDAPIdentity> resolveIdentity(LDAPAuthentication authentication) throws IdentityException Description copied from interface:IdentityResolver
Resolves the identity of the authenticated entity from the specified authentication.
- Specified by:
resolveIdentity
in interfaceIdentityResolver<LDAPAuthentication,
LDAPIdentity> - Parameters:
authentication
- an authentication- Returns:
- a mono emitting the resolved identity or an empty mono if no identity could have been resolved
- Throws:
IdentityException
- of there was an error resolving the identity
-