Class LdapRealm
java.lang.Object
org.elasticsearch.xpack.core.security.authc.Realm
org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm
org.elasticsearch.xpack.security.authc.ldap.LdapRealm
- All Implemented Interfaces:
Comparable<org.elasticsearch.xpack.core.security.authc.Realm>,org.elasticsearch.xpack.core.security.authc.support.CachingRealm
Authenticates username/password tokens against ldap, locates groups and maps them to roles.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.core.security.authc.Realm
org.elasticsearch.xpack.core.security.authc.Realm.Factory -
Field Summary
Fields inherited from class org.elasticsearch.xpack.core.security.authc.Realm
config, logger -
Constructor Summary
ConstructorsConstructorDescriptionLdapRealm(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.xpack.core.ssl.SSLService sslService, org.elasticsearch.watcher.ResourceWatcherService watcherService, NativeRoleMappingStore nativeRoleMappingStore, org.elasticsearch.threadpool.ThreadPool threadPool) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoAuthenticate(org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken token, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.AuthenticationResult<org.elasticsearch.xpack.core.security.user.User>> listener) Given a username and password, open a connection to ldap, bind to authenticate, retrieve groups, map to roles and build the user.protected voiddoLookupUser(String username, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.user.User> userActionListener) protected voidhandleCachedAuthentication(org.elasticsearch.xpack.core.security.user.User user, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.AuthenticationResult<org.elasticsearch.xpack.core.security.user.User>> listener) handleCachedAuthenticationis called when aUseris retrieved from the cache.voidinitialize(Iterable<org.elasticsearch.xpack.core.security.authc.Realm> realms, org.elasticsearch.license.XPackLicenseState licenseState) voidusageStats(org.elasticsearch.action.ActionListener<Map<String, Object>> listener) Methods inherited from class org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm
authenticate, expire, expireAll, getCacheSize, lookupUser, supports, tokenMethods inherited from class org.elasticsearch.xpack.core.security.authc.Realm
compareTo, domain, getAuthenticationFailureHeaders, name, order, toString, typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.core.security.authc.support.CachingRealm
name
-
Constructor Details
-
LdapRealm
public LdapRealm(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.xpack.core.ssl.SSLService sslService, org.elasticsearch.watcher.ResourceWatcherService watcherService, NativeRoleMappingStore nativeRoleMappingStore, org.elasticsearch.threadpool.ThreadPool threadPool) throws com.unboundid.ldap.sdk.LDAPException - Throws:
com.unboundid.ldap.sdk.LDAPException
-
-
Method Details
-
doAuthenticate
protected void doAuthenticate(org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken token, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.AuthenticationResult<org.elasticsearch.xpack.core.security.user.User>> listener) Given a username and password, open a connection to ldap, bind to authenticate, retrieve groups, map to roles and build the user. This user will then be passed to the listener- Specified by:
doAuthenticatein classCachingUsernamePasswordRealm
-
doLookupUser
protected void doLookupUser(String username, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.user.User> userActionListener) - Specified by:
doLookupUserin classCachingUsernamePasswordRealm
-
initialize
public void initialize(Iterable<org.elasticsearch.xpack.core.security.authc.Realm> realms, org.elasticsearch.license.XPackLicenseState licenseState) - Overrides:
initializein classorg.elasticsearch.xpack.core.security.authc.Realm
-
usageStats
- Overrides:
usageStatsin classCachingUsernamePasswordRealm
-
handleCachedAuthentication
protected void handleCachedAuthentication(org.elasticsearch.xpack.core.security.user.User user, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.AuthenticationResult<org.elasticsearch.xpack.core.security.user.User>> listener) Description copied from class:CachingUsernamePasswordRealmhandleCachedAuthenticationis called when aUseris retrieved from the cache. The firstuserparameter is the user object that was found in the cache. The default implementation returns asuccess resultwith the provided user, but sub-classes can return a differentUserobject, or an unsuccessful result.- Overrides:
handleCachedAuthenticationin classCachingUsernamePasswordRealm
-