public class BasicLdapLoginModule extends ClusterLoginModule
| Modifier and Type | Field and Description |
|---|---|
protected LdapContext |
ctx |
static boolean |
DEFAULT_PARSE_DN |
static int |
DEFAULT_ROLE_RECURSION_MAX_DEPTH
Role search recursion is disabled by default
|
static String |
DEFAULT_USER_NAME_ATTRIBUTE |
protected String |
login |
protected int |
maxRecursionDepth |
protected String |
name |
static String |
OPTION_PARSE_DN
Login module option name - If the option is set to
true, then it treats the value of the
roleMappingAttribute as a DN and extracts only roleNameAttribute attribute values as role names. |
static String |
OPTION_ROLE_CONTEXT
Login module option name - LDAP Context in which assigned roles are searched.
|
static String |
OPTION_ROLE_FILTER
Login module option name - LDAP search string which usually contains placeholder {memberDN} to be replaced by provided
login name.
|
static String |
OPTION_ROLE_MAPPING_ATTRIBUTE
Login module option name - Name of the LDAP attribute which contains either role name or role DN.
|
static String |
OPTION_ROLE_MAPPING_MODE
Login module option name - Role mapping mode - it can have one of the following values:
attribute - user object in the LDAP contains directly role name in the given attribute.
|
static String |
OPTION_ROLE_NAME_ATTRIBUTE
This option either refers to a name of LDAP attribute within role object which contains the role name in case of "direct"
and "reverse" roleMappingMode values.
|
static String |
OPTION_ROLE_RECURSION_MAX_DEPTH
Login module option name - Sets max depth of role search recursion.
|
static String |
OPTION_ROLE_SEARCH_SCOPE
LDAP search scope used for roleFilter search.
|
static String |
OPTION_USER_NAME_ATTRIBUTE
Login module option name - LDAP Attribute name which value will be used as a name in ClusterIdentityPrincipal added to
the JAAS Subject.
|
protected boolean |
parseFromDN |
protected String |
password |
static String |
PLACEHOLDER_DN
Placeholder string to be replaced by a user or role DN in the "roleFilter" option.
|
protected String |
roleContext |
protected String |
roleFilter |
protected String |
roleMappingAttribute |
protected com.hazelcast.config.security.LdapRoleMappingMode |
roleMappingMode |
protected String |
roleNameAttribute |
protected com.hazelcast.config.security.LdapSearchScope |
roleSearchScope |
protected Attributes |
userAttributes |
protected String |
userDN |
protected String |
userNameAttribute |
protected Set<String> |
visitedRoleDns |
callbackHandler, commitSucceeded, endpoint, logger, loginSucceeded, OPTION_SKIP_ENDPOINT, OPTION_SKIP_IDENTITY, OPTION_SKIP_ROLE, options, SHARED_STATE_IDENTITY, sharedState, subject| Constructor and Description |
|---|
BasicLdapLoginModule() |
| Modifier and Type | Method and Description |
|---|---|
protected LdapContext |
createLdapContext() |
protected String |
getName() |
protected com.hazelcast.config.security.LdapSearchScope |
getSearchScope(String optionName) |
protected boolean |
hasMoreIgnorePartResEx(NamingEnumeration<SearchResult> namingEnum) |
protected void |
initAuthentication() |
protected void |
logLdapContextProperties(Properties env) |
protected void |
onInitialize() |
protected boolean |
onLogin() |
protected Attributes |
setUserDnAndGetAttributes() |
protected void |
verifyOptions() |
abort, addRole, commit, getBoolOption, getIntOption, getLastIdentity, getStringOption, initialize, isSkipIdentity, isSkipRole, login, logout, onAbort, onCommit, onLogoutpublic static final String PLACEHOLDER_DN
public static final String OPTION_USER_NAME_ATTRIBUTE
public static final String OPTION_PARSE_DN
true, then it treats the value of the
roleMappingAttribute as a DN and extracts only roleNameAttribute attribute values as role names. When
the option value is false, then the whole value of roleMappingAttribute is used as a role name.
This option is only used when the roleMappingMode option has value "attribute".
public static final String OPTION_ROLE_MAPPING_MODE
public static final String OPTION_ROLE_MAPPING_ATTRIBUTE
This option is only used when the roleMappingMode option has value "attribute" or "direct".
public static final String OPTION_ROLE_CONTEXT
This option is only used when the roleMappingMode option has value "reverse".
public static final String OPTION_ROLE_FILTER
If the role search recursion is enabled (see roleRecursionMaxDepth), the {memberDN} is replaced by role DNs in the recurrent searches.
This option is only used when the roleMappingMode option has value "reverse".
public static final String OPTION_ROLE_RECURSION_MAX_DEPTH
This option is only used when the roleMappingMode option has value "direct" or "reverse".
public static final String OPTION_ROLE_NAME_ATTRIBUTE
public static final String OPTION_ROLE_SEARCH_SCOPE
LdapSearchScope enum:
This option is only used when the roleMappingMode option has value "reverse".
public static final String DEFAULT_USER_NAME_ATTRIBUTE
OPTION_USER_NAME_ATTRIBUTE,
Constant Field Valuespublic static final boolean DEFAULT_PARSE_DN
OPTION_PARSE_DN,
Constant Field Valuespublic static final int DEFAULT_ROLE_RECURSION_MAX_DEPTH
protected String name
protected String login
protected String password
protected String userDN
protected String userNameAttribute
protected String roleMappingAttribute
protected com.hazelcast.config.security.LdapRoleMappingMode roleMappingMode
protected String roleNameAttribute
protected String roleFilter
protected String roleContext
protected com.hazelcast.config.security.LdapSearchScope roleSearchScope
protected boolean parseFromDN
protected int maxRecursionDepth
protected Attributes userAttributes
protected LdapContext ctx
protected void onInitialize()
onInitialize in class ClusterLoginModuleprotected boolean onLogin()
throws LoginException
onLogin in class ClusterLoginModuleLoginExceptionprotected void initAuthentication()
throws FailedLoginException
FailedLoginExceptionprotected void verifyOptions()
protected Attributes setUserDnAndGetAttributes() throws NamingException, FailedLoginException
NamingExceptionFailedLoginExceptionprotected LdapContext createLdapContext() throws NamingException
NamingExceptionprotected void logLdapContextProperties(Properties env)
protected boolean hasMoreIgnorePartResEx(NamingEnumeration<SearchResult> namingEnum) throws NamingException
NamingExceptionprotected com.hazelcast.config.security.LdapSearchScope getSearchScope(String optionName)
protected String getName()
getName in class ClusterLoginModuleCopyright © 2022 Hazelcast, Inc.. All rights reserved.