Class AbstractEdAuthRealm
- java.lang.Object
-
- org.apache.catalina.util.LifecycleBase
-
- org.apache.catalina.util.LifecycleMBeanBase
-
- org.apache.catalina.realm.RealmBase
-
- edu.vt.middleware.ldap.ed.catalina.realm.AbstractEdAuthRealm
-
- All Implemented Interfaces:
MBeanRegistration,org.apache.catalina.Contained,org.apache.catalina.JmxEnabled,org.apache.catalina.Lifecycle,org.apache.catalina.Realm
- Direct Known Subclasses:
EdAuthRealm,LoginRealm
public abstract class AbstractEdAuthRealm extends org.apache.catalina.realm.RealmBaseBase class to provide drop in authentication against EdAuth using Catalina security realms.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected EdAuthServiceauthDirectory classprotected org.apache.catalina.UserDatabasedatabaseUsed to add additional roles to EdAuth users.protected org.slf4j.LoggerloggerClass logger instance.protected StringresourceNameThe global JNDI name of the EdAuth resource.-
Fields inherited from class org.apache.catalina.realm.RealmBase
allRolesMode, container, containerLog, realmPath, sm, stripRealmForGss, support, validate, x509UsernameRetriever, x509UsernameRetrieverClassName
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_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 Summary
Constructors Constructor Description AbstractEdAuthRealm(EdAuthService service, String name)Creates a new instance of an AbstractEdAuthRealm object that can provide authentication.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Principalauthenticate(String username, String credentials)This returns thePrincipalassociated with the specified username and credentials, if there is one; otherwise return null.Principalauthenticate(String username, String clientDigest, String nOnce, String nc, String cnonce, String qop, String realm, String md5a2)This method is not supported by this Realm.Principalauthenticate(X509Certificate[] certs)This method is not supported by this Realm.protected StringgetPassword(String username)This method is not supported by this Realm.protected PrincipalgetPrincipal(String username)This returns the principal associated with the supplied user name.StringgetResourceName()This returns the global JNDI name of theUserDatabaseresource used for adding additional roles to authenticated users.voidsetResourceName(String newResourceName)This sets the global JNDI name of theUserDatabaseresource used for adding additional roles to authenticated users.voidstartInternal()Prepare for active use of the public methods of this Component.voidstopInternal()Gracefully shut down active use of the public methods of this Component.-
Methods inherited from class org.apache.catalina.realm.RealmBase
addPropertyChangeListener, authenticate, authenticate, authenticate, backgroundProcess, findSecurityConstraints, getAllRolesMode, getContainer, getCredentialHandler, getDigest, getDomainInternal, getObjectNameKeyProperties, getPrincipal, getPrincipal, getPrincipal, getRealmPath, getRealmSuffix, getRoles, getServer, getTransportGuaranteeRedirectStatus, getValidate, getX509UsernameRetrieverClassName, hasMessageDigest, hasResourcePermission, hasRole, hasRoleInternal, hasUserDataPermission, initInternal, isStripRealmForGss, main, removePropertyChangeListener, setAllRolesMode, setContainer, setCredentialHandler, setRealmPath, setStripRealmForGss, setTransportGuaranteeRedirectStatus, setValidate, setX509UsernameRetrieverClassName, toString
-
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
-
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
-
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
Class logger instance.
-
database
protected org.apache.catalina.UserDatabase database
Used to add additional roles to EdAuth users.
-
resourceName
protected String resourceName
The global JNDI name of the EdAuth resource.
-
auth
protected EdAuthService auth
Directory class
-
-
Constructor Detail
-
AbstractEdAuthRealm
public AbstractEdAuthRealm(EdAuthService service, String name)
Creates a new instance of an AbstractEdAuthRealm object that can provide authentication.- Parameters:
service-EdAuthServiceto perform authenticationname-Stringglobal JNDI name
-
-
Method Detail
-
getResourceName
public String getResourceName()
This returns the global JNDI name of theUserDatabaseresource used for adding additional roles to authenticated users.- Returns:
String
-
setResourceName
public void setResourceName(String newResourceName)
This sets the global JNDI name of theUserDatabaseresource used for adding additional roles to authenticated users.- Parameters:
newResourceName-Stringnew global JNDI name
-
authenticate
public Principal authenticate(String username, String credentials)
This returns thePrincipalassociated with the specified username and credentials, if there is one; otherwise return null.
-
authenticate
public Principal authenticate(String username, String clientDigest, String nOnce, String nc, String cnonce, String qop, String realm, String md5a2)
This method is not supported by this Realm. It will always return null.
-
authenticate
public Principal authenticate(X509Certificate[] certs)
This method is not supported by this Realm. It will always return null.- Specified by:
authenticatein interfaceorg.apache.catalina.Realm- Overrides:
authenticatein classorg.apache.catalina.realm.RealmBase- Parameters:
certs- to authenticate- Returns:
Principal
-
getPassword
protected String getPassword(String username)
This method is not supported by this Realm. It will always return null.
-
getPrincipal
protected Principal getPrincipal(String username)
This returns the principal associated with the supplied user name.
-
startInternal
public void startInternal() throws org.apache.catalina.LifecycleExceptionPrepare for active use of the public methods of this Component.- Overrides:
startInternalin classorg.apache.catalina.realm.RealmBase- Throws:
org.apache.catalina.LifecycleException- if this component detects a fatal error that prevents it from being started
-
stopInternal
public void stopInternal() throws org.apache.catalina.LifecycleExceptionGracefully shut down active use of the public methods of this Component.- Overrides:
stopInternalin classorg.apache.catalina.realm.RealmBase- Throws:
org.apache.catalina.LifecycleException- if this component detects a fatal error that needs to be reported
-
-