public class CombinedRealm extends RealmBase
RealmBase.AllRolesModeLifecycle.SingleUse| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Realm> |
realms
The list of Realms contained by this Realm.
|
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 |
|---|
CombinedRealm() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRealm(Realm theRealm)
Add a realm to the list of realms that will be used to authenticate users.
|
java.security.Principal |
authenticate(org.ietf.jgss.GSSContext gssContext,
boolean storeCred)
Try to authenticate using a
GSSContext. |
java.security.Principal |
authenticate(org.ietf.jgss.GSSName gssName,
org.ietf.jgss.GSSCredential gssCredential)
Try to authenticate using a
GSSName. |
java.security.Principal |
authenticate(java.lang.String username)
Try to authenticate with the specified username.
|
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String credentials)
Try to authenticate using the specified username and
credentials.
|
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String clientDigest,
java.lang.String nonce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String qop,
java.lang.String realmName,
java.lang.String digestA2,
java.lang.String algorithm)
Try to authenticate with the specified username, which
matches the digest calculated using the given parameters using the
method described in RFC 7616.
|
java.security.Principal |
authenticate(java.security.cert.X509Certificate[] certs)
Try to authenticate using a chain of
X509Certificates. |
void |
backgroundProcess()
Delegate the backgroundProcess call to all sub-realms.
|
protected void |
destroyInternal()
Ensure child Realms are destroyed when this Realm is destroyed.
|
Realm[] |
getNestedRealms() |
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.
|
javax.management.ObjectName[] |
getRealms() |
boolean |
hasRole(Wrapper wrapper,
java.security.Principal principal,
java.lang.String role)
Check if the specified Principal has the specified
security role, within the context of this Realm.
|
boolean |
isAvailable()
Return the availability of the realm for authentication.
|
void |
setContainer(Container container)
Set the
Container with which this instance is associated. |
void |
setCredentialHandler(CredentialHandler credentialHandler)
Set the CredentialHandler to be used by this Realm.
|
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, findSecurityConstraints, getAllRolesMode, getContainer, getCredentialHandler, getDigest, getDigest, getDomainInternal, getObjectNameKeyProperties, getPrincipal, getPrincipal, getPrincipal, getRealmPath, getRealmSuffix, getRoles, getServer, getTransportGuaranteeRedirectStatus, getUserAttributes, getValidate, getX509UsernameRetrieverClassName, hasMessageDigest, hasResourcePermission, hasRoleInternal, hasUserDataPermission, initInternal, isStripRealmForGss, main, parseUserAttributes, removePropertyChangeListener, setAllRolesMode, setRealmPath, setStripRealmForGss, setTransportGuaranteeRedirectStatus, setUserAttributes, setValidate, setX509UsernameRetrieverClassName, toStringgetDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopprotected final java.util.List<Realm> realms
public void addRealm(Realm theRealm)
theRealm - realm which should be wrapped by the combined realmpublic javax.management.ObjectName[] getRealms()
public Realm[] getNestedRealms()
public java.security.Principal authenticate(java.lang.String username,
java.lang.String clientDigest,
java.lang.String nonce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String qop,
java.lang.String realmName,
java.lang.String digestA2,
java.lang.String algorithm)
Realm
The default implementation calls Realm.authenticate(String, String,
String, String, String, String, String, String) for backwards
compatibility which effectively forces the use of MD5 regardless of the
algorithm specified in the call to this method.
Implementations are expected to override the default implementation and take account of the algorithm parameter.
authenticate in interface Realmauthenticate in class RealmBaseusername - Username of the Principal to look upclientDigest - Digest which has been submitted by the clientnonce - Unique (or supposedly unique) token which has been used
for this requestnc - the nonce countercnonce - the client chosen nonceqop - the "quality of protection" (nc and cnonce
will only be used, if qop is not null).realmName - Realm namedigestA2 - Second digest calculated as digest(Method + ":" + uri)algorithm - The message digest algorithm to usenull if there is none.public java.security.Principal authenticate(java.lang.String username)
Realmauthenticate in interface Realmauthenticate in class RealmBaseusername - Username of the Principal to look upnull if none is associated.public java.security.Principal authenticate(java.lang.String username,
java.lang.String credentials)
Realmauthenticate in interface Realmauthenticate in class RealmBaseusername - Username of the Principal to look upcredentials - Password or other credentials to use in
authenticating this usernamenull if there is nonepublic void setContainer(Container container)
ContainedContainer with which this instance is associated.setContainer in interface ContainedsetContainer in class RealmBasecontainer - The Container instance with which this instance is to
be associated, or null to disassociate this instance
from any Containerprotected 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 reportedprotected void destroyInternal()
throws LifecycleException
destroyInternal in class LifecycleMBeanBaseLifecycleException - If the destruction failspublic void backgroundProcess()
backgroundProcess in interface RealmbackgroundProcess in class RealmBasepublic java.security.Principal authenticate(java.security.cert.X509Certificate[] certs)
RealmX509Certificates.authenticate in interface Realmauthenticate in class RealmBasecerts - Array of client certificates, with the first one in
the array being the certificate of the client itself.null if there is nonepublic java.security.Principal authenticate(org.ietf.jgss.GSSContext gssContext,
boolean storeCred)
RealmGSSContext.authenticate in interface Realmauthenticate in class RealmBasegssContext - The gssContext processed by the Authenticator.storeCred - Should the realm attempt to store the delegated
credentials in the returned Principal?null if there is nonepublic java.security.Principal authenticate(org.ietf.jgss.GSSName gssName,
org.ietf.jgss.GSSCredential gssCredential)
RealmGSSName.
Note that this default method will be turned into an abstract one in
Tomcat 10.authenticate in interface Realmauthenticate in class RealmBasegssName - The GSSName of the principal to look upgssCredential - The GSSCredential of the principal, may be
nullnull if there is nonepublic boolean hasRole(Wrapper wrapper, java.security.Principal principal, java.lang.String role)
RealmBase
This method or RealmBase.hasRoleInternal(Principal, String) can be overridden by Realm implementations, but the
default is adequate when an instance of GenericPrincipal is used to represent authenticated
Principals from this Realm.
hasRole in interface RealmhasRole in class RealmBasewrapper - wrapper context for evaluating roleprincipal - Principal for whom the role is to be checkedrole - Security role to be checkedtrue if the specified Principal has the specified
security role, within the context of this Realm; otherwise return
false.protected java.lang.String getPassword(java.lang.String username)
RealmBasegetPassword in class RealmBaseusername - The user nameprotected java.security.Principal getPrincipal(java.lang.String username)
RealmBasegetPrincipal in class RealmBaseusername - The user namepublic boolean isAvailable()
Realmtrue if the realm is able to perform authenticationpublic void setCredentialHandler(CredentialHandler credentialHandler)
RealmsetCredentialHandler in interface RealmsetCredentialHandler in class RealmBasecredentialHandler - the CredentialHandler to useCopyright © 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.