Class sun.server.http.security.DigestAuthentication
All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.http.security.DigestAuthentication
java.lang.Object
|
+----sun.server.http.security.DigestAuthentication
- public class DigestAuthentication
- extends Object
- implements HttpAuthentication
DigestAuthentication
This class implements MD5 based Digest authentication in accordance
with draft-ietf-http-digest-aa-04
-
DigestAuthentication(String, HttpSecurityAclInfo)
-
-
authenticate(HttpRequest)
- A function that authenticates the digest request by reading the
authenticate header field in the HTTP request.
-
generateNonce(HttpRequest)
- generates nonce string using the remote host address and current
time, checks for existence of the same nonce, put nonce, remote
address, and timestamp into nonce table
-
getRealm()
- returns the realm of the authentication.
-
getScheme()
- returns the name of the authentication scheme.
-
sendError(HttpRequest, HttpResponse)
- sends a authorization error to the client.
DigestAuthentication
public DigestAuthentication(String realm,
HttpSecurityAclInfo aclInfo)
getScheme
public String getScheme()
- returns the name of the authentication scheme.
- Returns:
- "Digest"
getRealm
public String getRealm()
- returns the realm of the authentication.
- Returns:
- the realm name
authenticate
public String authenticate(HttpRequest req) throws AuthenticationException
- A function that authenticates the digest request by reading the
authenticate header field in the HTTP request.
- Parameters:
- req - the Http request header.
- Returns:
- the name of the authenticated user.
- Throws: AuthenticationException
- is thrown if the request is unauthenticated.
generateNonce
public String generateNonce(HttpRequest req)
- generates nonce string using the remote host address and current
time, checks for existence of the same nonce, put nonce, remote
address, and timestamp into nonce table
- Parameters:
- req - HttpRequest
sendError
public void sendError(HttpRequest req,
HttpResponse res) throws IOException
- sends a authorization error to the client.
- Parameters:
- req - request
- res - response
All Packages Class Hierarchy This Package Previous Next Index