Class OpenIdLoginService
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.security.openid.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.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested 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, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionOpenIdLoginService(OpenIdConfiguration configuration) OpenIdLoginService(OpenIdConfiguration configuration, org.eclipse.jetty.security.LoginService loginService) Use a wrappedLoginServiceto store information about user roles. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jetty.security.IdentityServicegetName()booleanorg.eclipse.jetty.security.UserIdentitylogin(String identifier, Object credentials, org.eclipse.jetty.server.Request request, Function<Boolean, org.eclipse.jetty.server.Session> getOrCreateSession) voidlogout(org.eclipse.jetty.security.UserIdentity user) voidsetAuthenticateNewUsers(boolean authenticateNewUsers) This setting is only meaningful if a wrappedLoginServicehas been set.voidsetIdentityService(org.eclipse.jetty.security.IdentityService service) booleanvalidate(org.eclipse.jetty.security.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, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.security.LoginService
getUserIdentity
-
Constructor Details
-
OpenIdLoginService
-
OpenIdLoginService
public OpenIdLoginService(OpenIdConfiguration configuration, org.eclipse.jetty.security.LoginService loginService) Use a wrappedLoginServiceto 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 Details
-
getName
- Specified by:
getNamein interfaceorg.eclipse.jetty.security.LoginService
-
getConfiguration
-
login
public org.eclipse.jetty.security.UserIdentity login(String identifier, Object credentials, org.eclipse.jetty.server.Request request, Function<Boolean, org.eclipse.jetty.server.Session> getOrCreateSession) - Specified by:
loginin interfaceorg.eclipse.jetty.security.LoginService
-
isAuthenticateNewUsers
public boolean isAuthenticateNewUsers() -
setAuthenticateNewUsers
public void setAuthenticateNewUsers(boolean authenticateNewUsers) This setting is only meaningful if a wrappedLoginServicehas been set.If set to true, any users not found by the wrapped
LoginServicewill still be authenticated but with no roles, if set to false users will not be authenticated unless they are discovered by the wrappedLoginService.- Parameters:
authenticateNewUsers- whether to authenticate users not found by a wrapping LoginService
-
validate
public boolean validate(org.eclipse.jetty.security.UserIdentity user) - Specified by:
validatein interfaceorg.eclipse.jetty.security.LoginService
-
getIdentityService
public org.eclipse.jetty.security.IdentityService getIdentityService()- Specified by:
getIdentityServicein interfaceorg.eclipse.jetty.security.LoginService
-
setIdentityService
public void setIdentityService(org.eclipse.jetty.security.IdentityService service) - Specified by:
setIdentityServicein interfaceorg.eclipse.jetty.security.LoginService
-
logout
public void logout(org.eclipse.jetty.security.UserIdentity user) - Specified by:
logoutin interfaceorg.eclipse.jetty.security.LoginService
-