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.LoginServiceThe 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, 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
-
-
Constructor Summary
Constructors Constructor Description OpenIdLoginService(OpenIdConfiguration configuration)OpenIdLoginService(OpenIdConfiguration configuration, org.eclipse.jetty.security.LoginService loginService)Use a wrappedLoginServiceto store information about user roles.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenIdConfigurationgetConfiguration()org.eclipse.jetty.security.IdentityServicegetIdentityService()java.lang.StringgetName()booleanisAuthenticateNewUsers()org.eclipse.jetty.server.UserIdentitylogin(java.lang.String identifier, java.lang.Object credentials, javax.servlet.ServletRequest req)voidlogout(org.eclipse.jetty.server.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.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, 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
-
-
-
-
Constructor Detail
-
OpenIdLoginService
public OpenIdLoginService(OpenIdConfiguration configuration)
-
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 Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceorg.eclipse.jetty.security.LoginService
-
getConfiguration
public OpenIdConfiguration getConfiguration()
-
login
public org.eclipse.jetty.server.UserIdentity login(java.lang.String identifier, java.lang.Object credentials, javax.servlet.ServletRequest req)- 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.server.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.server.UserIdentity user)
- Specified by:
logoutin interfaceorg.eclipse.jetty.security.LoginService
-
-