public class JDBCUserRealm extends HashUserRealm
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
__SSO, _roles
Constructor and Description |
---|
JDBCUserRealm(String name)
Constructor.
|
JDBCUserRealm(String name,
String config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Principal |
authenticate(String username,
Object credentials,
HttpRequest request)
Authenticate a users credentials.
|
void |
connectDatabase()
(re)Connect to database with parameters setup by loadConfig()
|
void |
loadConfig(String config)
Load JDBC connection configuration from properties file.
|
void |
logout(Principal user)
logout a user Principal.
|
addUserToRole, clearSingleSignOn, disassociate, dump, getName, getPrincipal, getSingleSignOn, getSSORealm, isUserInRole, load, popRole, pushRole, put, readExternal, reauthenticate, setName, setSingleSignOn, setSSORealm, toString, writeExternal
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode
public JDBCUserRealm(String name)
name
- public JDBCUserRealm(String name, String config) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
name
- Realm nameconfig
- Filename or url of JDBC connection properties file.IOException
ClassNotFoundException
InstantiationException
IllegalAccessException
public void loadConfig(String config) throws IOException
config
- Filename or url of user properties file.IOException
public void logout(Principal user)
UserRealm
logout
in interface UserRealm
logout
in class HashUserRealm
user
- A Principal previously returned from this realmpublic void connectDatabase()
public Principal authenticate(String username, Object credentials, HttpRequest request)
UserRealm
authenticate
in interface UserRealm
authenticate
in class HashUserRealm
username
- The username.credentials
- The user credentials, normally a String password.request
- The request to be authenticated. Additional
parameters may be extracted or set on this request as needed
for the authentication mechanism (none required for BASIC and
FORM authentication).Copyright © 2016. All Rights Reserved.