Class OpenIdLoginService

  • All Implemented Interfaces:
    org.eclipse.jetty.security.LoginService, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

    public class OpenIdLoginService
    extends org.eclipse.jetty.util.component.ContainerLifeCycle
    implements org.eclipse.jetty.security.LoginService
    The implementation of LoginService required to use OpenID Connect.

    Can contain an optional wrapped LoginService which is used to store role information about users.

    • Nested Class Summary

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

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

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

        org.eclipse.jetty.util.component.Dumpable.DumpableContainer
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

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

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      OpenIdConfiguration getConfiguration()  
      org.eclipse.jetty.security.IdentityService getIdentityService()  
      java.lang.String getName()  
      boolean isAuthenticateNewUsers()  
      org.eclipse.jetty.server.UserIdentity login​(java.lang.String identifier, java.lang.Object credentials, javax.servlet.ServletRequest req)  
      void logout​(org.eclipse.jetty.server.UserIdentity user)  
      void setAuthenticateNewUsers​(boolean authenticateNewUsers)
      This setting is only meaningful if a wrapped LoginService has been set.
      void setIdentityService​(org.eclipse.jetty.security.IdentityService service)  
      boolean validate​(org.eclipse.jetty.server.UserIdentity user)  
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.component.Container

        getCachedBeans, getEventListeners
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dumpSelf
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

        isDumpable
    • Constructor Detail

      • OpenIdLoginService

        public OpenIdLoginService​(OpenIdConfiguration configuration,
                                  org.eclipse.jetty.security.LoginService loginService)
        Use a wrapped LoginService to store information about user roles. Users in the wrapped loginService must be stored with their username as the value of the sub (subject) Claim, and a credentials value of the empty string.
        Parameters:
        configuration - the OpenID configuration to use.
        loginService - the wrapped LoginService to defer to for user roles.
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface org.eclipse.jetty.security.LoginService
      • login

        public org.eclipse.jetty.server.UserIdentity login​(java.lang.String identifier,
                                                           java.lang.Object credentials,
                                                           javax.servlet.ServletRequest req)
        Specified by:
        login in interface org.eclipse.jetty.security.LoginService
      • isAuthenticateNewUsers

        public boolean isAuthenticateNewUsers()
      • setAuthenticateNewUsers

        public void setAuthenticateNewUsers​(boolean authenticateNewUsers)
        This setting is only meaningful if a wrapped LoginService has been set.

        If set to true, any users not found by the wrapped LoginService will still be authenticated but with no roles, if set to false users will not be authenticated unless they are discovered by the wrapped LoginService.

        Parameters:
        authenticateNewUsers - whether to authenticate users not found by a wrapping LoginService
      • validate

        public boolean validate​(org.eclipse.jetty.server.UserIdentity user)
        Specified by:
        validate in interface org.eclipse.jetty.security.LoginService
      • getIdentityService

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

        public void setIdentityService​(org.eclipse.jetty.security.IdentityService service)
        Specified by:
        setIdentityService in interface org.eclipse.jetty.security.LoginService
      • logout

        public void logout​(org.eclipse.jetty.server.UserIdentity user)
        Specified by:
        logout in interface org.eclipse.jetty.security.LoginService