@Service public final class LDAPRealm extends BaseRealm
See LDAPLoginModule documentation for more details on the operation of the LDAP realm and login module.
The ldap realm needs the following properties in its configuration:
Besides JDK Context properties start with java.naming, javax.security, one can also set connection pool related properties starting with com.sun.jndi.ldap.connect.pool. See http://java.sun.com/products/jndi/tutorial/ldap/connect/config.html for details. Also, the following optional attributes can also be specified:
uid=%s where %s is expanded to the username.
uniquemember=%d where %d is expanded to the DN of the user found by the user search.
cn.
LDAPLoginModule| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_TYPE |
static String |
DEFAULT_POOL_PROTOCOL |
static String |
DEFAULT_SSL_LDAP_SOCKET_FACTORY |
static String |
DYNAMIC_GROUP_FACTORY_OBJECT_PROPERTY |
static String |
DYNAMIC_GROUP_FILTER |
static String |
DYNAMIC_GROUP_STATE_FACTORY_PROPERTY |
protected static Logger |
groupSearchLogger |
static String |
LDAP_SOCKET_FACTORY |
static String |
LDAPS_URL |
static String |
MODE_FIND_BIND |
static String |
PARAM_BINDDN |
static String |
PARAM_BINDPWD |
static String |
PARAM_DIRURL |
static String |
PARAM_DYNAMIC_GRP_FILTER |
static String |
PARAM_DYNAMIC_GRP_TARGET |
static String |
PARAM_GRP_SEARCH_FILTER |
static String |
PARAM_GRP_TARGET |
static String |
PARAM_GRPDN |
static String |
PARAM_JNDICF |
static String |
PARAM_MODE |
static String |
PARAM_POOLSIZE |
static String |
PARAM_SEARCH_FILTER |
static String |
PARAM_USERDN |
static String |
SSL |
static String |
SUBST_SUBJECT_DN |
static String |
SUBST_SUBJECT_NAME |
JAAS_CONTEXT_PARAM, sm_logger, RI_DEFAULTgroupMapper, PARAM_GROUP_MAPPING| Constructor and Description |
|---|
LDAPRealm() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
findAndBind(String _username,
char[] _password)
Supports mode=find-bind.
|
String |
getAuthType()
Returns a short (preferably less than fifteen characters) description of the kind of authentication which is
supported by this realm.
|
Enumeration |
getGroupNames(String username)
Returns the name of all the groups that this user belongs to.
|
void |
init(Properties props)
Initialize a realm with some properties.
|
addUser, addUser, getGroupNames, getUser, getUserNames, persist, refresh, removeUser, supportsUserManagement, updateUser, updateUsergetDefaultInstance, getDefaultRealm, getInstance, getInstance, getRealmNames, getRealmStatsProvier, instantiate, instantiate, isValidRealm, isValidRealm, setDefaultRealm, unloadInstance, unloadInstance, updateInstance, updateInstanceaddAssignGroups, compareTo, getDefaultDigestAlgorithm, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, refresh, setName, setProperty, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompareToprotected static final Logger groupSearchLogger
public static final String AUTH_TYPE
public static final String PARAM_DIRURL
public static final String PARAM_USERDN
public static final String PARAM_SEARCH_FILTER
public static final String PARAM_GRPDN
public static final String PARAM_GRP_SEARCH_FILTER
public static final String PARAM_GRP_TARGET
public static final String PARAM_DYNAMIC_GRP_FILTER
public static final String PARAM_DYNAMIC_GRP_TARGET
public static final String PARAM_MODE
public static final String PARAM_JNDICF
public static final String PARAM_POOLSIZE
public static final String PARAM_BINDDN
public static final String PARAM_BINDPWD
public static final String MODE_FIND_BIND
public static final String SUBST_SUBJECT_NAME
public static final String SUBST_SUBJECT_DN
public static final String DYNAMIC_GROUP_FACTORY_OBJECT_PROPERTY
public static final String DYNAMIC_GROUP_STATE_FACTORY_PROPERTY
public static final String LDAP_SOCKET_FACTORY
public static final String DEFAULT_SSL_LDAP_SOCKET_FACTORY
public static final String LDAPS_URL
public static final String DEFAULT_POOL_PROTOCOL
public static final String DYNAMIC_GROUP_FILTER
public static final String SSL
public void init(Properties props) throws BadRealmException, NoSuchRealmException
init in class AbstractStatefulRealmprops - Initialization parameters used by this realm.BadRealmException - If the configuration parameters identify a corrupt realm.NoSuchRealmException - If the configuration parameters specify a realm which doesn't exist.public String getAuthType()
getAuthType in class AbstractRealmpublic Enumeration getGroupNames(String username) throws InvalidOperationException, NoSuchUserException
getGroupNames in class AbstractRealmusername - Name of the user in this realm whose group listing is needed.InvalidOperationException - thrown if the realm does not support this operation - e.g. Certificate realm
does not support this operation.NoSuchUserExceptionpublic String[] findAndBind(String _username, char[] _password) throws LoginException
_username - _password - LoginExceptionCopyright © 2019. All rights reserved.