Package org.eclipse.jetty.security
Class SecurityHandler
- All Implemented Interfaces:
Authenticator.AuthConfiguration,Handler,HandlerContainer,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle
- Direct Known Subclasses:
ConstraintSecurityHandler
@Deprecated(since="2021-05-27")
public abstract class SecurityHandler
extends HandlerWrapper
implements Authenticator.AuthConfiguration
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
Abstract SecurityHandler.
Select and apply an Authenticator to a request.
The Authenticator may either be directly set on the handler
or will be create during AbstractLifeCycle.start() with a call to
either the default or set AuthenticatorFactory.
SecurityHandler has a set of initparameters that are used by the Authentication.Configuration. At startup, any context init parameters that start with "org.eclipse.jetty.security." that do not have values in the SecurityHandler init parameters, are copied.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PrincipalDeprecated.static final PrincipalDeprecated.Nobody user. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated.Deprecated.static SecurityHandlerDeprecated.Deprecated.Get the identityService.getInitParameter(String key) Deprecated.Get a SecurityHandler init parameterDeprecated.Get a SecurityHandler init parameter namesDeprecated.Deprecated.Get the loginService.Deprecated.voidhandle(String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response) Deprecated.Handle a request.booleanDeprecated.booleanDeprecated.voidlogout(Authentication.User user) Deprecated.voidsetAuthenticator(Authenticator authenticator) Deprecated.Set the authenticator.voidsetAuthenticatorFactory(Authenticator.Factory authenticatorFactory) Deprecated.voidsetAuthMethod(String authMethod) Deprecated.voidsetCheckWelcomeFiles(boolean authenticateWelcomeFiles) Deprecated.voidsetIdentityService(IdentityService identityService) Deprecated.Set the identityService.setInitParameter(String key, String value) Deprecated.Set an initialization parameter.voidsetLoginService(LoginService loginService) Deprecated.Set the loginService.voidsetRealmName(String realmName) Deprecated.voidsetSessionRenewedOnAuthentication(boolean renew) Deprecated.Set renew the session on Authentication.Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, getHandler, getHandlers, insertHandler, setHandlerMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServerMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Field Details
-
__NO_USER
Deprecated. -
__NOBODY
Deprecated.Nobody user. The Nobody UserPrincipal is used to indicate a partial state of authentication. A request with a Nobody UserPrincipal will be allowed past all authentication constraints - but will not be considered an authenticated request. It can be used by Authenticators such as FormAuthenticator to allow access to logon and error pages within an authenticated URI tree.
-
-
Method Details
-
getIdentityService
Deprecated.Get the identityService.- Specified by:
getIdentityServicein interfaceAuthenticator.AuthConfiguration- Returns:
- the identityService
-
setIdentityService
Deprecated.Set the identityService.- Parameters:
identityService- the identityService to set
-
getLoginService
Deprecated.Get the loginService.- Specified by:
getLoginServicein interfaceAuthenticator.AuthConfiguration- Returns:
- the loginService
-
setLoginService
Deprecated.Set the loginService.- Parameters:
loginService- the loginService to set
-
getAuthenticator
Deprecated. -
setAuthenticator
Deprecated.Set the authenticator.- Parameters:
authenticator- the authenticator- Throws:
IllegalStateException- if the SecurityHandler is running
-
getAuthenticatorFactory
Deprecated.- Returns:
- the authenticatorFactory
-
setAuthenticatorFactory
Deprecated.- Parameters:
authenticatorFactory- the authenticatorFactory to set- Throws:
IllegalStateException- if the SecurityHandler is running
-
getKnownAuthenticatorFactories
Deprecated.- Returns:
- the list of discovered authenticatorFactories
-
getRealmName
Deprecated.- Specified by:
getRealmNamein interfaceAuthenticator.AuthConfiguration- Returns:
- the realmName
-
setRealmName
Deprecated.- Parameters:
realmName- the realmName to set- Throws:
IllegalStateException- if the SecurityHandler is running
-
getAuthMethod
Deprecated.- Specified by:
getAuthMethodin interfaceAuthenticator.AuthConfiguration- Returns:
- the authMethod
-
setAuthMethod
Deprecated.- Parameters:
authMethod- the authMethod to set- Throws:
IllegalStateException- if the SecurityHandler is running
-
isCheckWelcomeFiles
public boolean isCheckWelcomeFiles()Deprecated.- Returns:
- True if forwards to welcome files are authenticated
-
setCheckWelcomeFiles
public void setCheckWelcomeFiles(boolean authenticateWelcomeFiles) Deprecated.- Parameters:
authenticateWelcomeFiles- True if forwards to welcome files are authenticated- Throws:
IllegalStateException- if the SecurityHandler is running
-
getInitParameter
Deprecated.Description copied from interface:Authenticator.AuthConfigurationGet a SecurityHandler init parameter- Specified by:
getInitParameterin interfaceAuthenticator.AuthConfiguration- Parameters:
key- parameter name- Returns:
- Parameter value or null
- See Also:
-
getInitParameterNames
Deprecated.Description copied from interface:Authenticator.AuthConfigurationGet a SecurityHandler init parameter names- Specified by:
getInitParameterNamesin interfaceAuthenticator.AuthConfiguration- Returns:
- Set of parameter names
- See Also:
-
setInitParameter
Deprecated.Set an initialization parameter.- Parameters:
key- the init keyvalue- the init value- Returns:
- previous value
- Throws:
IllegalStateException- if the SecurityHandler is started
-
isSessionRenewedOnAuthentication
public boolean isSessionRenewedOnAuthentication()Deprecated.- Specified by:
isSessionRenewedOnAuthenticationin interfaceAuthenticator.AuthConfiguration- See Also:
-
setSessionRenewedOnAuthentication
public void setSessionRenewedOnAuthentication(boolean renew) Deprecated.Set renew the session on Authentication.If set to true, then on authentication, the session associated with a reqeuest is invalidated and replaced with a new session.
- Parameters:
renew- true to renew the authentication on session- See Also:
-
handle
public void handle(String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Deprecated.Description copied from interface:HandlerHandle a request.- Specified by:
handlein interfaceHandler- Overrides:
handlein classHandlerWrapper- Parameters:
pathInContext- The target of the request - either a URI or a name.baseRequest- The original unwrapped request object.request- The request either as theRequestobject or a wrapper of that request. Themethod can be used access the Request object if required.HttpConnection.getCurrentConnection().getHttpChannel().getRequest()response- The response as theResponseobject or a wrapper of that request. Themethod can be used access the Response object if required.HttpConnection.getCurrentConnection().getHttpChannel().getResponse()- Throws:
IOException- if unable to handle the request or response processingServletException- if unable to handle the request or response due to underlying servlet issue
-
getCurrentSecurityHandler
Deprecated. -
logout
Deprecated.
-