Authenticatorpublic 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.
| Modifier and Type | Class | Description |
|---|---|---|
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| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
__FORM_DISPATCH |
|
static java.lang.String |
__FORM_ERROR_PAGE |
|
static java.lang.String |
__FORM_LOGIN_PAGE |
|
static java.lang.String |
__J_METHOD |
|
static java.lang.String |
__J_PASSWORD |
|
static java.lang.String |
__J_POST |
|
static java.lang.String |
__J_SECURITY_CHECK |
|
static java.lang.String |
__J_URI |
|
static java.lang.String |
__J_USERNAME |
_identityService, _loginService| Constructor | Description |
|---|---|
FormAuthenticator() |
|
FormAuthenticator(java.lang.String login,
java.lang.String error,
boolean dispatch) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
getAlwaysSaveUri() |
|
java.lang.String |
getAuthMethod() |
|
boolean |
isJSecurityCheck(java.lang.String uri) |
|
boolean |
isLoginOrErrorPage(java.lang.String pathInContext) |
|
UserIdentity |
login(java.lang.String username,
java.lang.Object password,
ServletRequest request) |
|
void |
prepareRequest(ServletRequest request) |
Called prior to validateRequest.
|
boolean |
secureResponse(ServletRequest req,
ServletResponse res,
boolean mandatory,
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
|
Authentication |
validateRequest(ServletRequest req,
ServletResponse res,
boolean mandatory) |
Validate a request
|
getLoginService, renewSessionpublic static final java.lang.String __FORM_LOGIN_PAGE
public static final java.lang.String __FORM_ERROR_PAGE
public static final java.lang.String __FORM_DISPATCH
public static final java.lang.String __J_URI
public static final java.lang.String __J_POST
public static final java.lang.String __J_METHOD
public static final java.lang.String __J_SECURITY_CHECK
public static final java.lang.String __J_USERNAME
public static final java.lang.String __J_PASSWORD
public FormAuthenticator()
public FormAuthenticator(java.lang.String login,
java.lang.String error,
boolean dispatch)
public void setAlwaysSaveUri(boolean alwaysSave)
alwaysSave - true to always save the uripublic boolean getAlwaysSaveUri()
public void setConfiguration(Authenticator.AuthConfiguration configuration)
AuthenticatorsetConfiguration in interface AuthenticatorsetConfiguration in class LoginAuthenticatorconfiguration - the configurationLoginAuthenticator.setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration)public java.lang.String getAuthMethod()
public UserIdentity login(java.lang.String username, java.lang.Object password, ServletRequest request)
login in class LoginAuthenticatorpublic void prepareRequest(ServletRequest request)
AuthenticatorprepareRequest in interface AuthenticatorprepareRequest in class LoginAuthenticatorrequest - the request to manipulatepublic Authentication validateRequest(ServletRequest req, 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(java.lang.String uri)
public boolean isLoginOrErrorPage(java.lang.String pathInContext)
public boolean secureResponse(ServletRequest req, ServletResponse res, boolean mandatory, Authentication.User validatedUser) throws ServerAuthException
Authenticatorreq - the requestres - the responsemandatory - if security is mandatorvalidatedUser - the user that was validatedServerAuthException - if unable to test responseCopyright © 1995–2018 Webtide. All rights reserved.