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.RealmBase
Base class to provide drop in authentication against EdAuth using Catalina security realms.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected EdAuthService
auth
Directory classprotected org.apache.catalina.UserDatabase
database
Used to add additional roles to EdAuth users.protected org.slf4j.Logger
logger
Class logger instance.protected String
resourceName
The 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 Principal
authenticate(String username, String credentials)
This returns thePrincipal
associated with the specified username and credentials, if there is one; otherwise return null.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.Principal
authenticate(X509Certificate[] certs)
This method is not supported by this Realm.protected String
getPassword(String username)
This method is not supported by this Realm.protected Principal
getPrincipal(String username)
This returns the principal associated with the supplied user name.String
getResourceName()
This returns the global JNDI name of theUserDatabase
resource used for adding additional roles to authenticated users.void
setResourceName(String newResourceName)
This sets the global JNDI name of theUserDatabase
resource used for adding additional roles to authenticated users.void
startInternal()
Prepare for active use of the public methods of this Component.void
stopInternal()
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
-EdAuthService
to perform authenticationname
-String
global JNDI name
-
-
Method Detail
-
getResourceName
public String getResourceName()
This returns the global JNDI name of theUserDatabase
resource used for adding additional roles to authenticated users.- Returns:
String
-
setResourceName
public void setResourceName(String newResourceName)
This sets the global JNDI name of theUserDatabase
resource used for adding additional roles to authenticated users.- Parameters:
newResourceName
-String
new global JNDI name
-
authenticate
public Principal authenticate(String username, String credentials)
This returns thePrincipal
associated 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:
authenticate
in interfaceorg.apache.catalina.Realm
- Overrides:
authenticate
in 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.LifecycleException
Prepare for active use of the public methods of this Component.- Overrides:
startInternal
in 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.LifecycleException
Gracefully shut down active use of the public methods of this Component.- Overrides:
stopInternal
in classorg.apache.catalina.realm.RealmBase
- Throws:
org.apache.catalina.LifecycleException
- if this component detects a fatal error that needs to be reported
-
-