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,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 LoginService
The implementation ofLoginServicerequired to use OpenID Connect.Can contain an optional wrapped
LoginServicewhich 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
-
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
-
-
Constructor Summary
Constructors Constructor Description OpenIdLoginService(OpenIdConfiguration configuration)OpenIdLoginService(OpenIdConfiguration configuration, LoginService loginService)Use a wrappedLoginServiceto store information about user roles.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenIdConfigurationgetConfiguration()IdentityServicegetIdentityService()java.lang.StringgetName()booleanisAuthenticateNewUsers()UserIdentitylogin(java.lang.String identifier, java.lang.Object credentials, javax.servlet.ServletRequest req)voidlogout(UserIdentity user)voidsetAuthenticateNewUsers(boolean authenticateNewUsers)This setting is only meaningful if a wrappedLoginServicehas been set.voidsetIdentityService(IdentityService service)booleanvalidate(UserIdentity user)-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
-
-
-
Constructor Detail
-
OpenIdLoginService
public OpenIdLoginService(OpenIdConfiguration configuration)
-
OpenIdLoginService
public OpenIdLoginService(OpenIdConfiguration configuration, 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 Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceLoginService
-
getConfiguration
public OpenIdConfiguration getConfiguration()
-
login
public UserIdentity login(java.lang.String identifier, java.lang.Object credentials, javax.servlet.ServletRequest req)
- Specified by:
loginin interfaceLoginService
-
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(UserIdentity user)
- Specified by:
validatein interfaceLoginService
-
getIdentityService
public IdentityService getIdentityService()
- Specified by:
getIdentityServicein interfaceLoginService
-
setIdentityService
public void setIdentityService(IdentityService service)
- Specified by:
setIdentityServicein interfaceLoginService
-
logout
public void logout(UserIdentity user)
- Specified by:
logoutin interfaceLoginService
-
-