public class FormAuthenticator extends LoginAuthenticator
This authenticator implements form authentication will use dispatchers to
the login page if the __FORM_DISPATCH init parameter is set to true.
Otherwise it will redirect.
The form authenticator redirects unauthenticated requests to a log page
which should use a form to gather username/password from the user and send them
to the /j_security_check URI within the context. FormAuthentication uses
SessionAuthentication to wrap Authentication results so that they
are associated with the session.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
FormAuthenticator.FormAuthentication
This Authentication represents a just completed Form authentication.
|
protected static class |
FormAuthenticator.FormRequest |
protected static class |
FormAuthenticator.FormResponse |
Authenticator.AuthConfiguration, Authenticator.Factory| 限定符和类型 | 字段和说明 |
|---|---|
static String |
__FORM_DISPATCH |
static String |
__FORM_ERROR_PAGE |
static String |
__FORM_LOGIN_PAGE |
static String |
__J_METHOD |
static String |
__J_PASSWORD |
static String |
__J_POST |
static String |
__J_SECURITY_CHECK |
static String |
__J_URI |
static String |
__J_USERNAME |
_identityService, _loginService| 构造器和说明 |
|---|
FormAuthenticator() |
FormAuthenticator(String login,
String error,
boolean dispatch) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
getAlwaysSaveUri() |
String |
getAuthMethod() |
boolean |
isJSecurityCheck(String uri) |
boolean |
isLoginOrErrorPage(String pathInContext) |
org.eclipse.jetty.server.UserIdentity |
login(String username,
Object password,
javax.servlet.ServletRequest request) |
void |
prepareRequest(javax.servlet.ServletRequest request)
Called prior to validateRequest.
|
boolean |
secureResponse(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory,
org.eclipse.jetty.server.Authentication.User validatedUser)
is response secure
|
void |
setAlwaysSaveUri(boolean alwaysSave)
If true, uris that cause a redirect to a login page will always
be remembered.
|
void |
setConfiguration(Authenticator.AuthConfiguration configuration)
Configure the Authenticator
|
org.eclipse.jetty.server.Authentication |
validateRequest(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory)
Validate a request
|
getLoginService, renewSessionpublic void setAlwaysSaveUri(boolean alwaysSave)
alwaysSave - true to always save the uripublic boolean getAlwaysSaveUri()
public void setConfiguration(Authenticator.AuthConfiguration configuration)
AuthenticatorsetConfiguration 在接口中 AuthenticatorsetConfiguration 在类中 LoginAuthenticatorconfiguration - the configurationAuthenticator.setConfiguration(AuthConfiguration)public String getAuthMethod()
public org.eclipse.jetty.server.UserIdentity login(String username, Object password, javax.servlet.ServletRequest request)
login 在类中 LoginAuthenticatorpublic void prepareRequest(javax.servlet.ServletRequest request)
AuthenticatorprepareRequest 在接口中 AuthenticatorprepareRequest 在类中 LoginAuthenticatorrequest - the request to manipulatepublic org.eclipse.jetty.server.Authentication validateRequest(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory)
throws ServerAuthException
Authenticatorreq - The requestres - The responsemandatory - True if authentication is mandatory.Authentication.User. If a response has
been sent by the Authenticator (which can be done for both successful and unsuccessful authentications), then the result will
implement Authentication.ResponseSent. If Authentication is not manditory, then a
Authentication.Deferred may be returned.ServerAuthException - if unable to validate requestpublic boolean isJSecurityCheck(String uri)
public boolean isLoginOrErrorPage(String pathInContext)
public boolean secureResponse(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory,
org.eclipse.jetty.server.Authentication.User validatedUser)
throws ServerAuthException
Authenticatorreq - the requestres - the responsemandatory - if security is mandatorvalidatedUser - the user that was validatedServerAuthException - if unable to test responseCopyright © 2017. All rights reserved.