@Service public final class JDBCRealm extends DigestRealmBase
The JDBC realm needs the following properties in its configuration:
Modifier and Type | Field and Description |
---|---|
static String |
AUTH_TYPE
Descriptive string of the authentication type of this realm.
|
static String |
BASE64 |
static String |
DEFAULT_ENCODING |
static String |
HEX |
static String |
NONE |
static String |
PARAM_CHARSET |
static String |
PARAM_DATASOURCE_JNDI |
static String |
PARAM_DB_PASSWORD |
static String |
PARAM_DB_USER |
static String |
PARAM_DIGEST_ALGORITHM |
static String |
PARAM_ENCODING |
static String |
PARAM_GROUP_NAME_COLUMN |
static String |
PARAM_GROUP_TABLE |
static String |
PARAM_GROUP_TABLE_USER_NAME_COLUMN |
static String |
PARAM_PASSWORD_COLUMN |
static String |
PARAM_USER_NAME_COLUMN |
static String |
PARAM_USER_TABLE |
static String |
PRE_HASHED |
_logger, JAAS_CONTEXT_PARAM, RI_DEFAULT
groupMapper, GROUPS_SEP, PARAM_DEFAULT_DIGEST_ALGORITHM, PARAM_GROUP_MAPPING, PARAM_GROUPS
Constructor and Description |
---|
JDBCRealm() |
Modifier and Type | Method and Description |
---|---|
String[] |
authenticate(String username,
char[] password)
Invoke the native authentication call.
|
String |
getAuthType()
Returns a short (preferably less than fifteen characters) description of the kind of authentication which is
supported by this realm.
|
Enumeration<String> |
getGroupNames(String username)
Returns the name of all the groups that this user belongs to.
|
protected void |
init(Properties props)
Initialize a realm with some properties.
|
boolean |
validate(String username,
DigestAlgorithmParameter[] params) |
validate
addUser, addUser, getGroupNames, getUser, getUserNames, persist, refresh, removeUser, supportsUserManagement, updateUser, updateUser
getDefaultInstance, getDefaultRealm, getInstance, getInstance, getRealmNames, getRealmStatsProvier, instantiate, instantiate, isValidRealm, isValidRealm, setDefaultRealm, unloadInstance, unloadInstance, updateInstance, updateInstance
addAssignGroups, compareTo, getDefaultDigestAlgorithm, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, refresh, setName, setProperty, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compareTo
public static final String AUTH_TYPE
public static final String PRE_HASHED
public static final String PARAM_DATASOURCE_JNDI
public static final String PARAM_DB_USER
public static final String PARAM_DB_PASSWORD
public static final String PARAM_DIGEST_ALGORITHM
public static final String NONE
public static final String PARAM_ENCODING
public static final String HEX
public static final String BASE64
public static final String DEFAULT_ENCODING
public static final String PARAM_CHARSET
public static final String PARAM_USER_TABLE
public static final String PARAM_USER_NAME_COLUMN
public static final String PARAM_PASSWORD_COLUMN
public static final String PARAM_GROUP_TABLE
public static final String PARAM_GROUP_NAME_COLUMN
public static final String PARAM_GROUP_TABLE_USER_NAME_COLUMN
protected void init(Properties props) throws BadRealmException, NoSuchRealmException
AbstractStatefulRealm
init
in class AbstractStatefulRealm
props
- initialization parameters used by this realm.BadRealmException
- if the configuration parameters identify a corrupt realmNoSuchRealmException
- if the configuration parameters specify a realm which doesn't
existpublic String getAuthType()
getAuthType
in class AbstractRealm
public Enumeration<String> getGroupNames(String username) throws InvalidOperationException, NoSuchUserException
getGroupNames
in class AbstractRealm
username
- 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.NoSuchUserException
public String[] authenticate(String username, char[] password)
username
- User to authenticate.password
- Given password.public boolean validate(String username, DigestAlgorithmParameter[] params)
Copyright © 2021. All rights reserved.