Class 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.RealmBase
    Simple 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".

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.catalina.realm.RealmBase

        org.apache.catalina.realm.RealmBase.AllRolesMode
      • Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

        org.apache.catalina.Lifecycle.SingleUse
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static String info
      Descriptive information about this Realm implementation.
      protected static String name
      Descriptive 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 class org.apache.catalina.util.LifecycleMBeanBase

        mserver
      • 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
      Principal authenticate​(String username, String credentials)
      Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
      String getInfo()
      Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.
      protected String getName()
      Return a short name for this Realm implementation.
      protected String getPassword​(String username)
      Return the password associated with the given principal's user name.
      protected Principal getPrincipal​(String username)  
      boolean hasRole​(Principal principal, String role)  
      boolean hasRole​(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
      • Methods inherited from interface org.apache.catalina.Realm

        isAvailable
    • Constructor Detail

      • DavRealm

        public DavRealm()
    • 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 return null.
        Specified by:
        authenticate in interface org.apache.catalina.Realm
        Overrides:
        authenticate in class org.apache.catalina.realm.RealmBase
        Parameters:
        username - Username of the Principal to look up
        credentials - 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:
        getPrincipal in class org.apache.catalina.realm.RealmBase
      • getPassword

        protected String getPassword​(String username)
        Return the password associated with the given principal's user name.
        Specified by:
        getPassword in class org.apache.catalina.realm.RealmBase
      • hasRole

        public boolean hasRole​(org.apache.catalina.Wrapper wrapper,
                               Principal principal,
                               String role)
        Specified by:
        hasRole in interface org.apache.catalina.Realm
        Overrides:
        hasRole in class org.apache.catalina.realm.RealmBase