|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.jwebkit.JWFilter
net.spy.jwebkit.auth.AuthFilter
net.spy.jwebkit.auth.FormAuthFilter
public class FormAuthFilter
Handler for form-based authenticators.
| Field Summary | |
|---|---|
static java.lang.String |
LOGIN_ACTION
The name of the action that logs in the user. |
static java.lang.String |
LOGIN_URI
The name of the next URI to visit (if applicable). |
static java.lang.String |
PASSWORD_PARAM
The name of the form field containing the password. |
static java.lang.String |
USERNAME_PARAM
The name of the form field containing the username. |
| Fields inherited from class net.spy.jwebkit.auth.AuthFilter |
|---|
AUTH_REQ_HEADER, AUTH_RES_HEADER |
| Constructor Summary | |
|---|---|
FormAuthFilter()
|
|
| Method Summary | |
|---|---|
protected java.security.Principal |
checkPassword(java.lang.String user,
java.lang.String pass)
Check the username and password of the current user. |
protected void |
doCheckedFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
Run whatever authentication filters need to be attempted here. |
protected void |
doNoAuthChain(javax.servlet.http.HttpServletRequest hreq,
javax.servlet.http.HttpServletResponse hres,
javax.servlet.FilterChain chain,
java.lang.String form,
boolean recordLocation)
Executed when the user is not authenticated. |
protected java.lang.String |
getAuthForm()
Get the path to the auth form. |
protected java.lang.String |
getAuthType()
Get the authentication type used by this filter. |
protected java.lang.String |
getFailedAuthForm()
Get the path to the auth form. |
protected java.lang.String |
getLoginAction()
Get the action path that will be authenticating this user. |
protected java.lang.String |
getLoginURI()
Get the name of the request parameter that will tell us where to forward the user after authentication. |
protected java.lang.String |
getPasswordParam()
Get the name of the parameter containing the password. |
protected java.lang.String |
getUsernameParam()
Get the name of the parameter containing the username. |
void |
init(javax.servlet.FilterConfig c)
|
| Methods inherited from class net.spy.jwebkit.auth.AuthFilter |
|---|
doAuthedChain, doFilter, getAuthAdaptor, getRequestWithPrincipal, getRequestWithPrincipal |
| Methods inherited from class net.spy.jwebkit.JWFilter |
|---|
destroy, getConfig |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String USERNAME_PARAM
public static final java.lang.String PASSWORD_PARAM
public static final java.lang.String LOGIN_ACTION
public static final java.lang.String LOGIN_URI
| Constructor Detail |
|---|
public FormAuthFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig c)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterinit in class AuthFilterjavax.servlet.ServletExceptionprotected java.lang.String getAuthForm()
protected java.lang.String getFailedAuthForm()
protected void doNoAuthChain(javax.servlet.http.HttpServletRequest hreq,
javax.servlet.http.HttpServletResponse hres,
javax.servlet.FilterChain chain,
java.lang.String form,
boolean recordLocation)
throws java.io.IOException,
javax.servlet.ServletException
recordLocation is true when the client is not authenticated and we are not attempting to authenticate the user. It is false when the client has failed to authenticate. This allows the filter to send the client back to the original page it was requesting after authentication completes.
hreq - the requesthres - the responsechain - the chainrecordLocation - if true, record the current location
java.io.IOException
javax.servlet.ServletExceptionprotected java.lang.String getUsernameParam()
protected java.lang.String getPasswordParam()
protected java.lang.String getLoginAction()
protected java.lang.String getLoginURI()
protected java.lang.String getAuthType()
AuthFilter
getAuthType in class AuthFilterHttpServletRequest
protected void doCheckedFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
AuthFilter
doCheckedFilter in class AuthFilterreq - the requestres - the responsechain - the chain
java.io.IOException - if there are errors reading or writing
javax.servlet.ServletException - if there's a general error
protected java.security.Principal checkPassword(java.lang.String user,
java.lang.String pass)
throws javax.servlet.ServletException
user - the usernamepass - the password
javax.servlet.ServletException - if something goes horribly, horribly wrong
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||