Package org.sakaiproject.dav
Class DavRealm
- java.lang.Object
-
- org.apache.catalina.util.LifecycleBase
-
- org.apache.catalina.util.LifecycleMBeanBase
-
- org.apache.catalina.realm.RealmBase
-
- org.sakaiproject.dav.DavRealm
-
- All Implemented Interfaces:
MBeanRegistration,org.apache.catalina.Contained,org.apache.catalina.JmxEnabled,org.apache.catalina.Lifecycle,org.apache.catalina.Realm
public final class DavRealm extends org.apache.catalina.realm.RealmBaseSimple implementation of Realm that consults the Sakai user directory service to provide container security equivalent to then application security in CHEF.IMPLEMENTATION NOTE: The user is assumed to have all "roles" because servlets and teamlets will enforce roles within Sakai - so in this realm, we simply indicate "true".
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringinfoDescriptive information about this Realm implementation.protected static StringnameDescriptive information about this Realm implementation.-
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 DavRealm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Principalauthenticate(String username, String credentials)Return the Principal associated with the specified username and credentials, if there is one; otherwise returnnull.StringgetInfo()Return descriptive information about this Realm implementation and the corresponding version number, in the format<description>/<version>.protected StringgetName()Return a short name for this Realm implementation.protected StringgetPassword(String username)Return the password associated with the given principal's user name.protected PrincipalgetPrincipal(String username)booleanhasRole(Principal principal, String role)booleanhasRole(org.apache.catalina.Wrapper wrapper, Principal principal, String role)-
Methods inherited from class org.apache.catalina.realm.RealmBase
addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, authenticate, backgroundProcess, findSecurityConstraints, getAllRolesMode, getContainer, getCredentialHandler, getDigest, getDomainInternal, getObjectNameKeyProperties, getPrincipal, getPrincipal, getPrincipal, getRealmPath, getRealmSuffix, getRoles, getServer, getTransportGuaranteeRedirectStatus, getValidate, getX509UsernameRetrieverClassName, hasMessageDigest, hasResourcePermission, hasRoleInternal, hasUserDataPermission, initInternal, isStripRealmForGss, main, removePropertyChangeListener, setAllRolesMode, setContainer, setCredentialHandler, setRealmPath, setStripRealmForGss, setTransportGuaranteeRedirectStatus, setValidate, setX509UsernameRetrieverClassName, startInternal, stopInternal, 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
-
info
protected static final String info
Descriptive information about this Realm implementation.- See Also:
- Constant Field Values
-
name
protected static final String name
Descriptive information about this Realm implementation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInfo
public String getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format<description>/<version>.
-
authenticate
public Principal authenticate(String username, String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise returnnull.- Specified by:
authenticatein interfaceorg.apache.catalina.Realm- Overrides:
authenticatein classorg.apache.catalina.realm.RealmBase- Parameters:
username- Username of the Principal to look upcredentials- Password or other credentials to use in authenticating this username
-
getName
protected String getName()
Return a short name for this Realm implementation.
-
getPrincipal
protected Principal getPrincipal(String username)
- Specified by:
getPrincipalin classorg.apache.catalina.realm.RealmBase
-
getPassword
protected String getPassword(String username)
Return the password associated with the given principal's user name.- Specified by:
getPasswordin classorg.apache.catalina.realm.RealmBase
-
hasRole
public boolean hasRole(org.apache.catalina.Wrapper wrapper, Principal principal, String role)- Specified by:
hasRolein interfaceorg.apache.catalina.Realm- Overrides:
hasRolein classorg.apache.catalina.realm.RealmBase
-
-