|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.resources.AttributeHolder org.w3c.tools.resources.Resource org.w3c.tools.resources.FramedResource org.w3c.tools.resources.ResourceFrame org.w3c.tools.resources.ResourceFilter org.w3c.jigsaw.auth.AuthFilter org.w3c.jigsaw.auth.DigestAuthFilter
public class DigestAuthFilter
DigestAuthFilter provides for both IP and digest authentication. This is really a first implementation. It looses on several points:
Nested Class Summary | |
---|---|
class |
DigestAuthFilter.DigestAuthContext
|
Field Summary | |
---|---|
protected static int |
ATTR_ALGORITHM
Attribute index - The algorithm used |
protected static int |
ATTR_ALLOWED_GROUPS
Attribute index - The list of allowed groups. |
protected static int |
ATTR_ALLOWED_USERS
Attribute index - The list of allowed users. |
protected static int |
ATTR_NONCE_TTL
Attribute index - The nonce time to live (in seconds) |
protected RealmsCatalog |
catalog
The catalog of realms that make our scope. |
protected HttpChallenge |
challenge
The challenge to issue to any client for Digest Authentication. |
protected java.lang.String |
loaded_realm
The nam of the realm we cache in realm . |
protected java.lang.String |
nonce
The nonce value of the digest, changed every X mn |
protected java.lang.String |
old_nonce
The previous nonce value of the digest, changed every X mn |
protected ResourceReference |
rr_realm
Our associated realm. |
Fields inherited from class org.w3c.jigsaw.auth.AuthFilter |
---|
ATTR_METHODS, ATTR_PRIVATE_CACHABILITY, ATTR_PUBLIC_CACHABILITY, ATTR_REALM, ATTR_SHARED_CACHABILITY, STATE_AUTHCONTEXT, STATE_AUTHTYPE, STATE_AUTHUSER |
Fields inherited from class org.w3c.tools.resources.ResourceFrame |
---|
filterClass, frameListener, resource |
Fields inherited from class org.w3c.tools.resources.FramedResource |
---|
ATTR_OID, attrListener, debugEvent, event_disabled, framesRef, structListener |
Fields inherited from class org.w3c.tools.resources.Resource |
---|
ATTR_CONTEXT, ATTR_HELP_URL, ATTR_IDENTIFIER, ATTR_LAST_MODIFIED, ATTR_PARENT, ATTR_RESOURCE_FRAMES, ATTR_STORE_ENTRY, ATTR_URL, co, id |
Fields inherited from class org.w3c.tools.resources.AttributeHolder |
---|
attributes, values |
Constructor Summary | |
---|---|
DigestAuthFilter()
|
Method Summary | |
---|---|
protected void |
acquireRealm()
Get a pointer to our realm, and initialize our ipmatcher. |
void |
authenticate(Request request)
Authenticate the given request. |
protected boolean |
checkRealm()
Check that our realm does exist. |
protected boolean |
checkUser(AuthUser user)
|
java.lang.String |
getAlgorithm()
Get the algorithm used |
java.lang.String[] |
getAllowedGroups()
Get the list of allowed groups. |
java.lang.String[] |
getAllowedUsers()
Get the list of allowed users. |
void |
initialize(java.lang.Object[] values)
Initialize the filter. |
ResourceReference |
lookupUser(java.lang.String name)
Lookup a user by its name. |
ReplyInterface |
outgoingFilter(RequestInterface request,
ReplyInterface reply)
Add the appropriate cache control directives on the way back. |
void |
setValue(int idx,
java.lang.Object value)
Catch set value on the realm, to maintain cached values. |
Methods inherited from class org.w3c.jigsaw.auth.AuthFilter |
---|
getMethods, getPrivateCachability, getPublicCachability, getRealm, getSharedCachability, lookup |
Methods inherited from class org.w3c.tools.resources.ResourceFilter |
---|
exceptionFilter, getTargetResource, ingoingFilter, ingoingFilter, initialize, outgoingFilter, outputFilter, pickleValues |
Methods inherited from class org.w3c.tools.resources.ResourceFrame |
---|
addFrameEventListener, attributeChanged, checkRequest, eventDisabled, fireFrameEvent, frameModified, getFilters, getFilters, getFrameReference, getResource, getResourceReference, getSpaceEntry, getURLPath, lookupFilters, lookupFrames, perform, postFrameEvent, processEvent, registerResource, removeFrameEventListener, unregisterResource, updateDefaultChildAttributes |
Methods inherited from class org.w3c.tools.resources.Resource |
---|
acceptUnload, checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getServer, getSpace, getStoreEntry, getValue, getValue, isInitialized, isUnloaded, setContext, setContext, setValue, unsafeGetContext, unsafeGetFrame, unsafeGetFrames, unsafeGetIdentifier, unsafeGetResourceReference, unsafeGetURLPath, unsafeGetValue, updateAttributes |
Methods inherited from class org.w3c.tools.resources.AttributeHolder |
---|
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static int ATTR_ALLOWED_USERS
protected static int ATTR_ALLOWED_GROUPS
protected static int ATTR_ALGORITHM
protected static int ATTR_NONCE_TTL
protected RealmsCatalog catalog
protected ResourceReference rr_realm
protected java.lang.String loaded_realm
realm
.
protected HttpChallenge challenge
protected java.lang.String nonce
protected java.lang.String old_nonce
Constructor Detail |
---|
public DigestAuthFilter()
Method Detail |
---|
protected void acquireRealm()
protected boolean checkRealm()
public java.lang.String[] getAllowedUsers()
public java.lang.String[] getAllowedGroups()
public java.lang.String getAlgorithm()
public ResourceReference lookupUser(java.lang.String name)
name
- The user's name.
protected boolean checkUser(AuthUser user)
public void setValue(int idx, java.lang.Object value)
setValue
in class ResourceFrame
idx
- The index of the attribute to modify.value
- The new attribute value.public void authenticate(Request request) throws ProtocolException
If the IP address is found, than either our user entry requires an extra password step (in wich case we challenge it), or simple IP based authentication is enough, so we allow the request.
authenticate
in class AuthFilter
request
- The request to be authentified.
ProtocolException
- if authentication
failedpublic ReplyInterface outgoingFilter(RequestInterface request, ReplyInterface reply)
outgoingFilter
in class AuthFilter
request
- The request that has been processed.reply
- The original reply.
public void initialize(java.lang.Object[] values)
initialize
in class FramedResource
values
- Default attribute values.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |