public class UserDatabaseRealm extends RealmBase
Realm that is based on an implementation of UserDatabase made
available through the JNDI resources configured for this instance of Catalina. Set the resourceName
parameter to the JNDI resources name for the configured instance of UserDatabase that we should consult.| Modifier and Type | Class and Description |
|---|---|
static class |
UserDatabaseRealm.UserDatabasePrincipal |
RealmBase.AllRolesModeLifecycle.SingleUse| Modifier and Type | Field and Description |
|---|---|
protected UserDatabase |
database
The
UserDatabase we will use to authenticate users and identify associated roles. |
protected java.lang.String |
resourceName
The global JNDI name of the
UserDatabase resource we will be utilizing. |
allRolesMode, container, containerLog, realmPath, sm, stripRealmForGss, support, USER_ATTRIBUTES_DELIMITER, USER_ATTRIBUTES_WILDCARD, userAttributes, userAttributesList, validate, x509UsernameRetriever, x509UsernameRetrieverClassNamemserverAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
UserDatabaseRealm() |
| Modifier and Type | Method and Description |
|---|---|
void |
backgroundProcess()
|
boolean |
getLocalJndiResource()
Determines whether this Realm is configured to obtain the associated
UserDatabase from the global JNDI
context or a local (web application) JNDI context. |
protected java.lang.String |
getPassword(java.lang.String username)
Get the password for the specified user.
|
protected java.security.Principal |
getPrincipal(java.lang.String username)
Get the principal associated with the specified user.
|
java.lang.String |
getResourceName() |
static java.lang.String[] |
getRoles(User user) |
boolean |
getUseStaticPrincipal() |
boolean |
isAvailable()
Return the availability of the realm for authentication.
|
void |
setLocalJndiResource(boolean localJndiResource)
Configure whether this Realm obtains the associated
UserDatabase from the global JNDI context or a local
(web application) JNDI context. |
void |
setResourceName(java.lang.String resourceName)
Set the global JNDI name of the
UserDatabase resource we will be using. |
void |
setUseStaticPrincipal(boolean useStaticPrincipal)
Allows using a static principal disconnected from the user database.
|
protected void |
startInternal()
Prepare for the beginning of active use of the public methods of this component and implement the requirements of
LifecycleBase.startInternal(). |
protected void |
stopInternal()
Gracefully terminate the active use of the public methods of this component and implement the requirements of
LifecycleBase.stopInternal(). |
addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, findSecurityConstraints, getAllRolesMode, getContainer, getCredentialHandler, getDigest, getDigest, getDomainInternal, getObjectNameKeyProperties, getPrincipal, getPrincipal, getPrincipal, getRealmPath, getRealmSuffix, getRoles, getServer, getTransportGuaranteeRedirectStatus, getUserAttributes, getValidate, getX509UsernameRetrieverClassName, hasMessageDigest, hasResourcePermission, hasRole, hasRoleInternal, hasUserDataPermission, initInternal, isStripRealmForGss, main, parseUserAttributes, removePropertyChangeListener, setAllRolesMode, setContainer, setCredentialHandler, setRealmPath, setStripRealmForGss, setTransportGuaranteeRedirectStatus, setUserAttributes, setValidate, setX509UsernameRetrieverClassName, toStringdestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopprotected volatile UserDatabase database
UserDatabase we will use to authenticate users and identify associated roles.protected java.lang.String resourceName
UserDatabase resource we will be utilizing.public java.lang.String getResourceName()
UserDatabase resource we will be using.public void setResourceName(java.lang.String resourceName)
UserDatabase resource we will be using.resourceName - The new global JNDI namepublic boolean getUseStaticPrincipal()
public void setUseStaticPrincipal(boolean useStaticPrincipal)
useStaticPrincipal - the new valuepublic boolean getLocalJndiResource()
UserDatabase from the global JNDI
context or a local (web application) JNDI context.true if a local JNDI context will be used, false if the the global JNDI context will be
usedpublic void setLocalJndiResource(boolean localJndiResource)
UserDatabase from the global JNDI context or a local
(web application) JNDI context.localJndiResource - true to use a local JNDI context, false to use the global JNDI contextpublic void backgroundProcess()
backgroundProcess in interface RealmbackgroundProcess in class RealmBaseprotected java.lang.String getPassword(java.lang.String username)
RealmBasegetPassword in class RealmBaseusername - The user namepublic static java.lang.String[] getRoles(User user)
protected java.security.Principal getPrincipal(java.lang.String username)
RealmBasegetPrincipal in class RealmBaseusername - The user nameprotected void startInternal()
throws LifecycleException
RealmBaseLifecycleBase.startInternal().startInternal in class RealmBaseLifecycleException - if this component detects a fatal error that prevents this component from being
usedprotected void stopInternal()
throws LifecycleException
RealmBaseLifecycleBase.stopInternal().stopInternal in class RealmBaseLifecycleException - if this component detects a fatal error that needs to be reportedpublic boolean isAvailable()
Realmtrue if the realm is able to perform authenticationCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.