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:
 LoginService, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
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 AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendableNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener - 
Field Summary
 - 
Constructor Summary
ConstructorsConstructorDescriptionOpenIdLoginService(OpenIdConfiguration configuration) OpenIdLoginService(OpenIdConfiguration configuration, LoginService loginService) Use a wrappedLoginServiceto store information about user roles. - 
Method Summary
Modifier and TypeMethodDescriptionGet the IdentityService associated with this Login Service.getName()booleanlogin(String identifier, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession) Login a user.voidlogout(UserIdentity user) voidsetAuthenticateNewUsers(boolean authenticateNewUsers) This setting is only meaningful if a wrappedLoginServicehas been set.voidsetIdentityService(IdentityService service) Set the IdentityService associated with this Login Service.booleanvalidate(UserIdentity user) Validate a user identity.Methods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods inherited from interface LoginService
getUserIdentity 
- 
Constructor Details
- 
OpenIdLoginService
 - 
OpenIdLoginService
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 interfaceLoginService- Returns:
 - Get the name of the login service (aka Realm name)
 
 - 
getConfiguration
 - 
login
public UserIdentity login(String identifier, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession) Description copied from interface:LoginServiceLogin a user.- Specified by:
 loginin interfaceLoginService- Parameters:
 identifier- The username.credentials- The users credentials.request- The request or nullgetOrCreateSession- function to retrieve or create a session.- Returns:
 - A UserIdentity if the credentials matched, otherwise null
 
 - 
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
Description copied from interface:LoginServiceValidate a user identity. Validate that a UserIdentity previously created by a call toLoginService.login(String, Object, Request, Function)is still valid.- Specified by:
 validatein interfaceLoginService- Parameters:
 user- The user to validate- Returns:
 - true if authentication has not been revoked for the user.
 
 - 
getIdentityService
Description copied from interface:LoginServiceGet the IdentityService associated with this Login Service.- Specified by:
 getIdentityServicein interfaceLoginService- Returns:
 - the IdentityService associated with this Login Service.
 
 - 
setIdentityService
Description copied from interface:LoginServiceSet the IdentityService associated with this Login Service.- Specified by:
 setIdentityServicein interfaceLoginService- Parameters:
 service- the IdentityService associated with this Login Service.
 - 
logout
- Specified by:
 logoutin interfaceLoginService
 
 -