public abstract class SecurityHandler extends org.eclipse.jetty.server.handler.HandlerWrapper implements Authenticator.AuthConfiguration
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.
| 限定符和类型 | 类和说明 |
|---|---|
class |
SecurityHandler.NotChecked |
org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandlerorg.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener| 限定符 | 构造器和说明 |
|---|---|
protected |
SecurityHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
checkSecurity(org.eclipse.jetty.server.Request request) |
protected abstract boolean |
checkUserDataPermissions(String pathInContext,
org.eclipse.jetty.server.Request request,
org.eclipse.jetty.server.Response response,
RoleInfo constraintInfo) |
protected abstract boolean |
checkWebResourcePermissions(String pathInContext,
org.eclipse.jetty.server.Request request,
org.eclipse.jetty.server.Response response,
Object constraintInfo,
org.eclipse.jetty.server.UserIdentity userIdentity) |
protected void |
doStart() |
protected void |
doStop() |
protected IdentityService |
findIdentityService() |
protected LoginService |
findLoginService() |
Authenticator |
getAuthenticator() |
Authenticator.Factory |
getAuthenticatorFactory() |
String |
getAuthMethod() |
static SecurityHandler |
getCurrentSecurityHandler() |
IdentityService |
getIdentityService()
Get the identityService.
|
String |
getInitParameter(String key)
Get a SecurityHandler init parameter
|
Set<String> |
getInitParameterNames()
Get a SecurityHandler init parameter names
|
LoginService |
getLoginService()
Get the loginService.
|
String |
getRealmName() |
void |
handle(String pathInContext,
org.eclipse.jetty.server.Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected abstract boolean |
isAuthMandatory(org.eclipse.jetty.server.Request baseRequest,
org.eclipse.jetty.server.Response base_response,
Object constraintInfo) |
boolean |
isCheckWelcomeFiles() |
boolean |
isSessionRenewedOnAuthentication() |
void |
logout(org.eclipse.jetty.server.Authentication.User user) |
protected abstract RoleInfo |
prepareConstraintInfo(String pathInContext,
org.eclipse.jetty.server.Request request) |
void |
setAuthenticator(Authenticator authenticator)
Set the authenticator.
|
void |
setAuthenticatorFactory(Authenticator.Factory authenticatorFactory) |
void |
setAuthMethod(String authMethod) |
void |
setCheckWelcomeFiles(boolean authenticateWelcomeFiles) |
void |
setIdentityService(IdentityService identityService)
Set the identityService.
|
String |
setInitParameter(String key,
String value)
Set an initialization parameter.
|
void |
setLoginService(LoginService loginService)
Set the loginService.
|
void |
setRealmName(String realmName) |
void |
setSessionRenewedOnAuthentication(boolean renew)
Set renew the session on Authentication.
|
destroy, expandChildren, getHandler, getHandlers, insertHandler, setHandlerexpandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServeraddBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic static final Principal __NO_USER
public static final Principal __NOBODY
public IdentityService getIdentityService()
getIdentityService 在接口中 Authenticator.AuthConfigurationpublic void setIdentityService(IdentityService identityService)
identityService - the identityService to setpublic LoginService getLoginService()
getLoginService 在接口中 Authenticator.AuthConfigurationpublic void setLoginService(LoginService loginService)
loginService - the loginService to setpublic Authenticator getAuthenticator()
public void setAuthenticator(Authenticator authenticator)
authenticator - the authenticatorIllegalStateException - if the SecurityHandler is runningpublic Authenticator.Factory getAuthenticatorFactory()
public void setAuthenticatorFactory(Authenticator.Factory authenticatorFactory)
authenticatorFactory - the authenticatorFactory to setIllegalStateException - if the SecurityHandler is runningpublic String getRealmName()
getRealmName 在接口中 Authenticator.AuthConfigurationpublic void setRealmName(String realmName)
realmName - the realmName to setIllegalStateException - if the SecurityHandler is runningpublic String getAuthMethod()
getAuthMethod 在接口中 Authenticator.AuthConfigurationpublic void setAuthMethod(String authMethod)
authMethod - the authMethod to setIllegalStateException - if the SecurityHandler is runningpublic boolean isCheckWelcomeFiles()
public void setCheckWelcomeFiles(boolean authenticateWelcomeFiles)
authenticateWelcomeFiles - True if forwards to welcome files are
authenticatedIllegalStateException - if the SecurityHandler is runningpublic String getInitParameter(String key)
Authenticator.AuthConfigurationgetInitParameter 在接口中 Authenticator.AuthConfigurationkey - parameter namegetInitParameter(String)public Set<String> getInitParameterNames()
Authenticator.AuthConfigurationgetInitParameterNames 在接口中 Authenticator.AuthConfigurationgetInitParameterNames()public String setInitParameter(String key, String value)
key - the init keyvalue - the init valueIllegalStateException - if the SecurityHandler is runningprotected LoginService findLoginService() throws Exception
Exceptionprotected IdentityService findIdentityService()
protected void doStart()
throws Exception
doStart 在类中 org.eclipse.jetty.server.handler.AbstractHandlerExceptionprotected void doStop()
throws Exception
doStop 在类中 org.eclipse.jetty.server.handler.AbstractHandlerExceptionprotected boolean checkSecurity(org.eclipse.jetty.server.Request request)
public boolean isSessionRenewedOnAuthentication()
public void setSessionRenewedOnAuthentication(boolean renew)
If set to true, then on authentication, the session associated with a reqeuest is invalidated and replaced with a new session.
renew - true to renew the authentication on sessionAuthenticator.AuthConfiguration.isSessionRenewedOnAuthentication()public void handle(String pathInContext, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
handle 在接口中 org.eclipse.jetty.server.Handlerhandle 在类中 org.eclipse.jetty.server.handler.HandlerWrapperIOExceptionjavax.servlet.ServletExceptionpublic static SecurityHandler getCurrentSecurityHandler()
public void logout(org.eclipse.jetty.server.Authentication.User user)
protected abstract RoleInfo prepareConstraintInfo(String pathInContext, org.eclipse.jetty.server.Request request)
protected abstract boolean checkUserDataPermissions(String pathInContext, org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, RoleInfo constraintInfo) throws IOException
IOExceptionprotected abstract boolean isAuthMandatory(org.eclipse.jetty.server.Request baseRequest,
org.eclipse.jetty.server.Response base_response,
Object constraintInfo)
protected abstract boolean checkWebResourcePermissions(String pathInContext, org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, Object constraintInfo, org.eclipse.jetty.server.UserIdentity userIdentity) throws IOException
IOExceptionCopyright © 2017. All rights reserved.