|
||||||||||
| 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.DigestAuthFilter
public class DigestAuthFilter
AuthFilter implementating digest authentication.
| Nested Class Summary | |
|---|---|
protected static class |
DigestAuthFilter.ValidationState
Validation states for digest authentication. |
| Field Summary |
|---|
| Fields inherited from class net.spy.jwebkit.auth.AuthFilter |
|---|
AUTH_REQ_HEADER, AUTH_RES_HEADER |
| Constructor Summary | |
|---|---|
DigestAuthFilter()
|
|
| Method Summary | |
|---|---|
protected DigestAuthFilter.ValidationState |
checkCreds(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.util.Map<java.lang.String,java.lang.String> parsed)
Check the credentials of this client. |
protected java.lang.String |
computeResponse(java.lang.String ha1,
java.lang.String nonce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String auth,
java.lang.String ha2)
Compute a digest response. |
protected void |
doCheckedFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
Run whatever authentication filters need to be attempted here. |
void |
doNoAuthChain(javax.servlet.http.HttpServletRequest hreq,
javax.servlet.http.HttpServletResponse hres,
javax.servlet.FilterChain chain,
DigestAuthFilter.ValidationState state)
Invoked when the authentication credentials do not match, or the credentials are rejected. |
protected java.lang.String |
generateNonce()
Generate a nonce to be used in a digest challenge. |
protected java.lang.String |
generateOpaque()
Generate an opaque value to be used in a digest challenge. |
protected java.lang.String |
getAuthType()
Get the authentication type used by this filter. |
protected java.security.Principal |
getPrincipal(java.lang.String username)
Get a principal for the given authenticated username. |
void |
init(javax.servlet.FilterConfig c)
|
protected boolean |
isNonceValid(java.lang.String n)
Determine whether the given nonce should be considered valid. |
| 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 |
| Constructor Detail |
|---|
public DigestAuthFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig c)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterinit in class AuthFilterjavax.servlet.ServletException
public void doNoAuthChain(javax.servlet.http.HttpServletRequest hreq,
javax.servlet.http.HttpServletResponse hres,
javax.servlet.FilterChain chain,
DigestAuthFilter.ValidationState state)
throws java.io.IOException,
javax.servlet.ServletException
hreq - servlet requesthres - servlet responsechain - the current filter chainstate - the state (should be INVALID or STALE)
java.io.IOException
javax.servlet.ServletExceptionprotected java.lang.String generateNonce()
protected boolean isNonceValid(java.lang.String n)
n - the given nonce
protected java.lang.String generateOpaque()
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.lang.String computeResponse(java.lang.String ha1,
java.lang.String nonce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String auth,
java.lang.String ha2)
ha1 - H(unq(username-value) ":" unq(realm-value) ":" passwd)nonce - the nonce sent from the clientnc - the client nonce countcnonce - the client nonceauth - the qop typeha2 - H(Method ":" digest-uri-value)
protected DigestAuthFilter.ValidationState checkCreds(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.util.Map<java.lang.String,java.lang.String> parsed)
req - the requestres - the responseparsed - the parsed authorization header
protected java.security.Principal getPrincipal(java.lang.String username)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||