Class AbstractEdAuthRealm

  • All Implemented Interfaces:
    org.eclipse.jetty.security.LoginService, org.eclipse.jetty.util.component.LifeCycle
    Direct Known Subclasses:
    EdAuthRealm, LoginRealm

    public abstract class AbstractEdAuthRealm
    extends org.eclipse.jetty.util.component.AbstractLifeCycle
    implements org.eclipse.jetty.security.LoginService
    Base class to provide drop in authentication against EdAuth using Jetty security realms.
    Author:
    Middleware Services
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected EdAuthService auth
      Directory class
      protected org.eclipse.jetty.security.IdentityService identityService
      Default IdentityService for realm.
      protected org.slf4j.Logger logger
      Class logger instance.
      protected String realmName
      Descriptive information about this Realm implementation.
      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractEdAuthRealm​(EdAuthService service, String name)
      Creates a new instance of an EDAuthRealm object that can provide authentication against EdAuth for the production environment.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.jetty.security.IdentityService getIdentityService()
      Return the default IdentityService
      String getName()
      Returns the name of the realm.
      org.eclipse.jetty.server.UserIdentity login​(String username, Object credentials, javax.servlet.ServletRequest servletRequest)
      The core function which authenticates the user and gathers the roles.
      void logout​(org.eclipse.jetty.server.UserIdentity user)
      This method is not supported by this Realm.
      void setIdentityService​(org.eclipse.jetty.security.IdentityService iService)
      This method is not supported in this realm.
      void setName​(String name)
      Sets the name of the realm.
      boolean validate​(org.eclipse.jetty.server.UserIdentity user)
      This method will return true is the user is not null, false otherwise.
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        addLifeCycleListener, doStart, doStop, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
        Class logger instance.
      • identityService

        protected final org.eclipse.jetty.security.IdentityService identityService
        Default IdentityService for realm.
      • realmName

        protected String realmName
        Descriptive information about this Realm implementation.
    • Constructor Detail

      • AbstractEdAuthRealm

        public AbstractEdAuthRealm​(EdAuthService service,
                                   String name)
        Creates a new instance of an EDAuthRealm object that can provide authentication against EdAuth for the production environment.
        Parameters:
        service - EdAuthService to perform authentication
        name - String realm name
    • Method Detail

      • getName

        public String getName()
        Returns the name of the realm. (default: EdAuthRealm)
        Specified by:
        getName in interface org.eclipse.jetty.security.LoginService
        Returns:
        String
      • setName

        public void setName​(String name)
        Sets the name of the realm.
        Parameters:
        name - String
      • login

        public org.eclipse.jetty.server.UserIdentity login​(String username,
                                                           Object credentials,
                                                           javax.servlet.ServletRequest servletRequest)
        The core function which authenticates the user and gathers the roles.
        Specified by:
        login in interface org.eclipse.jetty.security.LoginService
        Parameters:
        username - String
        credentials - Object
        servletRequest - ServletRequest
        Returns:
        UserIdentity if the user is authenticated. returns null otherwise.
      • validate

        public boolean validate​(org.eclipse.jetty.server.UserIdentity user)
        This method will return true is the user is not null, false otherwise.
        Specified by:
        validate in interface org.eclipse.jetty.security.LoginService
        Parameters:
        user - UserIdentity
        Returns:
        boolean
      • logout

        public void logout​(org.eclipse.jetty.server.UserIdentity user)
        This method is not supported by this Realm. It will do nothing.
        Specified by:
        logout in interface org.eclipse.jetty.security.LoginService
        Parameters:
        user - UserIdentity
      • getIdentityService

        public org.eclipse.jetty.security.IdentityService getIdentityService()
        Return the default IdentityService
        Specified by:
        getIdentityService in interface org.eclipse.jetty.security.LoginService
        Returns:
        IdentityService
      • setIdentityService

        public void setIdentityService​(org.eclipse.jetty.security.IdentityService iService)
        This method is not supported in this realm.
        Specified by:
        setIdentityService in interface org.eclipse.jetty.security.LoginService
        Parameters:
        iService - IdentityService