public class FormAuthenticator
extends org.eclipse.jetty.security.authentication.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 and Description |
|---|---|
static class |
FormAuthenticator.FormAuthentication
This Authentication represents a just completed Form authentication.
|
protected static class |
FormAuthenticator.FormRequest |
protected static class |
FormAuthenticator.FormResponse |
| Modifier and Type | Field and 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_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 |
| Constructor and Description |
|---|
FormAuthenticator() |
FormAuthenticator(java.lang.String login,
java.lang.String error,
boolean dispatch,
boolean useRelativeRedirects) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAlwaysSaveUri() |
java.lang.String |
getAuthMethod() |
boolean |
getUseRelativeRedirects() |
boolean |
isJSecurityCheck(java.lang.String uri) |
boolean |
isLoginOrErrorPage(java.lang.String pathInContext) |
org.eclipse.jetty.server.UserIdentity |
login(java.lang.String username,
java.lang.Object password,
javax.servlet.ServletRequest request) |
boolean |
secureResponse(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory,
org.eclipse.jetty.server.Authentication.User validatedUser) |
void |
setAlwaysSaveUri(boolean alwaysSave)
If true, uris that cause a redirect to a login page will always
be remembered.
|
void |
setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration configuration) |
org.eclipse.jetty.server.Authentication |
validateRequest(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory) |
public 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_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,
boolean useRelativeRedirects)
public void setAlwaysSaveUri(boolean alwaysSave)
alwaysSave - public boolean getAlwaysSaveUri()
public boolean getUseRelativeRedirects()
public void setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration configuration)
setConfiguration in interface org.eclipse.jetty.security.AuthenticatorsetConfiguration in class org.eclipse.jetty.security.authentication.LoginAuthenticatorLoginAuthenticator.setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration)public java.lang.String getAuthMethod()
public org.eclipse.jetty.server.UserIdentity login(java.lang.String username,
java.lang.Object password,
javax.servlet.ServletRequest request)
login in class org.eclipse.jetty.security.authentication.LoginAuthenticatorpublic org.eclipse.jetty.server.Authentication validateRequest(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory)
throws org.eclipse.jetty.security.ServerAuthException
org.eclipse.jetty.security.ServerAuthExceptionpublic boolean isJSecurityCheck(java.lang.String uri)
public boolean isLoginOrErrorPage(java.lang.String pathInContext)
public boolean secureResponse(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
boolean mandatory,
org.eclipse.jetty.server.Authentication.User validatedUser)
throws org.eclipse.jetty.security.ServerAuthException
org.eclipse.jetty.security.ServerAuthException