Package org.eclipse.jetty.security
Class SecurityHandler
- java.lang.Object
-
- 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 Classes Modifier and Type Class Description class
SecurityHandler.NotChecked
Deprecated.-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static java.security.Principal
__NO_USER
Deprecated.static java.security.Principal
__NOBODY
Deprecated.Nobody user.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Authenticator
getAuthenticator()
Deprecated.Authenticator.Factory
getAuthenticatorFactory()
Deprecated.java.lang.String
getAuthMethod()
Deprecated.static SecurityHandler
getCurrentSecurityHandler()
Deprecated.IdentityService
getIdentityService()
Deprecated.Get the identityService.java.lang.String
getInitParameter(java.lang.String key)
Deprecated.Get a SecurityHandler init parameterjava.util.Set<java.lang.String>
getInitParameterNames()
Deprecated.Get a SecurityHandler init parameter namesjava.util.List<Authenticator.Factory>
getKnownAuthenticatorFactories()
Deprecated.LoginService
getLoginService()
Deprecated.Get the loginService.java.lang.String
getRealmName()
Deprecated.void
handle(java.lang.String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
Deprecated.Handle a request.boolean
isCheckWelcomeFiles()
Deprecated.boolean
isSessionRenewedOnAuthentication()
Deprecated.void
logout(Authentication.User user)
Deprecated.void
setAuthenticator(Authenticator authenticator)
Deprecated.Set the authenticator.void
setAuthenticatorFactory(Authenticator.Factory authenticatorFactory)
Deprecated.void
setAuthMethod(java.lang.String authMethod)
Deprecated.void
setCheckWelcomeFiles(boolean authenticateWelcomeFiles)
Deprecated.void
setIdentityService(IdentityService identityService)
Deprecated.Set the identityService.java.lang.String
setInitParameter(java.lang.String key, java.lang.String value)
Deprecated.Set an initialization parameter.void
setLoginService(LoginService loginService)
Deprecated.Set the loginService.void
setRealmName(java.lang.String realmName)
Deprecated.void
setSessionRenewedOnAuthentication(boolean renew)
Deprecated.Set renew the session on Authentication.-
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, getHandler, getHandlers, insertHandler, setHandler
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServer
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
getServer
-
Methods 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, 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
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Field Detail
-
__NO_USER
public static final java.security.Principal __NO_USER
Deprecated.
-
__NOBODY
public static final java.security.Principal __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 Detail
-
getIdentityService
public IdentityService getIdentityService()
Deprecated.Get the identityService.- Specified by:
getIdentityService
in interfaceAuthenticator.AuthConfiguration
- Returns:
- the identityService
-
setIdentityService
public void setIdentityService(IdentityService identityService)
Deprecated.Set the identityService.- Parameters:
identityService
- the identityService to set
-
getLoginService
public LoginService getLoginService()
Deprecated.Get the loginService.- Specified by:
getLoginService
in interfaceAuthenticator.AuthConfiguration
- Returns:
- the loginService
-
setLoginService
public void setLoginService(LoginService loginService)
Deprecated.Set the loginService.- Parameters:
loginService
- the loginService to set
-
getAuthenticator
public Authenticator getAuthenticator()
Deprecated.
-
setAuthenticator
public void setAuthenticator(Authenticator authenticator)
Deprecated.Set the authenticator.- Parameters:
authenticator
- the authenticator- Throws:
java.lang.IllegalStateException
- if the SecurityHandler is running
-
getAuthenticatorFactory
public Authenticator.Factory getAuthenticatorFactory()
Deprecated.- Returns:
- the authenticatorFactory
-
setAuthenticatorFactory
public void setAuthenticatorFactory(Authenticator.Factory authenticatorFactory)
Deprecated.- Parameters:
authenticatorFactory
- the authenticatorFactory to set- Throws:
java.lang.IllegalStateException
- if the SecurityHandler is running
-
getKnownAuthenticatorFactories
public java.util.List<Authenticator.Factory> getKnownAuthenticatorFactories()
Deprecated.- Returns:
- the list of discovered authenticatorFactories
-
getRealmName
public java.lang.String getRealmName()
Deprecated.- Specified by:
getRealmName
in interfaceAuthenticator.AuthConfiguration
- Returns:
- the realmName
-
setRealmName
public void setRealmName(java.lang.String realmName)
Deprecated.- Parameters:
realmName
- the realmName to set- Throws:
java.lang.IllegalStateException
- if the SecurityHandler is running
-
getAuthMethod
public java.lang.String getAuthMethod()
Deprecated.- Specified by:
getAuthMethod
in interfaceAuthenticator.AuthConfiguration
- Returns:
- the authMethod
-
setAuthMethod
public void setAuthMethod(java.lang.String authMethod)
Deprecated.- Parameters:
authMethod
- the authMethod to set- Throws:
java.lang.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:
java.lang.IllegalStateException
- if the SecurityHandler is running
-
getInitParameter
public java.lang.String getInitParameter(java.lang.String key)
Deprecated.Description copied from interface:Authenticator.AuthConfiguration
Get a SecurityHandler init parameter- Specified by:
getInitParameter
in interfaceAuthenticator.AuthConfiguration
- Parameters:
key
- parameter name- Returns:
- Parameter value or null
- See Also:
getInitParameter(String)
-
getInitParameterNames
public java.util.Set<java.lang.String> getInitParameterNames()
Deprecated.Description copied from interface:Authenticator.AuthConfiguration
Get a SecurityHandler init parameter names- Specified by:
getInitParameterNames
in interfaceAuthenticator.AuthConfiguration
- Returns:
- Set of parameter names
- See Also:
getInitParameterNames()
-
setInitParameter
public java.lang.String setInitParameter(java.lang.String key, java.lang.String value)
Deprecated.Set an initialization parameter.- Parameters:
key
- the init keyvalue
- the init value- Returns:
- previous value
- Throws:
java.lang.IllegalStateException
- if the SecurityHandler is started
-
isSessionRenewedOnAuthentication
public boolean isSessionRenewedOnAuthentication()
Deprecated.- Specified by:
isSessionRenewedOnAuthentication
in interfaceAuthenticator.AuthConfiguration
- See Also:
Authenticator.AuthConfiguration.isSessionRenewedOnAuthentication()
-
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:
Authenticator.AuthConfiguration.isSessionRenewedOnAuthentication()
-
handle
public void handle(java.lang.String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException
Deprecated.Description copied from interface:Handler
Handle a request.- Specified by:
handle
in interfaceHandler
- Overrides:
handle
in 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 theRequest
object or a wrapper of that request. The
method can be used access the Request object if required.HttpConnection.getCurrentConnection()
.getHttpChannel()
.getRequest()
response
- The response as theResponse
object or a wrapper of that request. The
method can be used access the Response object if required.HttpConnection.getCurrentConnection()
.getHttpChannel()
.getResponse()
- Throws:
java.io.IOException
- if unable to handle the request or response processingServletException
- if unable to handle the request or response due to underlying servlet issue
-
getCurrentSecurityHandler
public static SecurityHandler getCurrentSecurityHandler()
Deprecated.
-
logout
public void logout(Authentication.User user)
Deprecated.
-
-