Class DigestAuthenticator.DigestInfo
- java.lang.Object
-
- org.apache.catalina.authenticator.DigestAuthenticator.DigestInfo
-
- Enclosing class:
- DigestAuthenticator
public static class DigestAuthenticator.DigestInfo extends java.lang.ObjectHolds the parsed and validated information from a Digest authentication request.
-
-
Constructor Summary
Constructors Constructor Description DigestInfo(java.lang.String opaque, long nonceValidity, java.lang.String key, java.util.Map<java.lang.String,DigestAuthenticator.NonceInfo> nonces, boolean validateUri)Create a new DigestInfo instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.security.Principalauthenticate(Realm realm)Authenticate the user against the given realm using the parsed digest credentials.java.lang.StringgetUsername()Get the authenticated user name.booleanisNonceStale()Check if the nonce has expired and is considered stale.booleanparse(Request request, java.lang.String authorization)Parse the authorization header to extract digest credentials.booleanvalidate(Request request)Deprecated.booleanvalidate(Request request, java.util.List<DigestAuthenticator.AuthDigest> algorithms)Validate the parsed digest credentials against the request and configured algorithms.
-
-
-
Constructor Detail
-
DigestInfo
public DigestInfo(java.lang.String opaque, long nonceValidity, java.lang.String key, java.util.Map<java.lang.String,DigestAuthenticator.NonceInfo> nonces, boolean validateUri)Create a new DigestInfo instance.- Parameters:
opaque- Opaque stringnonceValidity- Nonce validity in millisecondskey- Private keynonces- Map of tracked noncesvalidateUri- Whether to validate the URI
-
-
Method Detail
-
getUsername
public java.lang.String getUsername()
Get the authenticated user name.- Returns:
- User name
-
parse
public boolean parse(Request request, java.lang.String authorization)
Parse the authorization header to extract digest credentials.- Parameters:
request- HTTP requestauthorization- Authorization header value- Returns:
trueif parsing succeeded
-
validate
@Deprecated public boolean validate(Request request)
Deprecated.
-
validate
public boolean validate(Request request, java.util.List<DigestAuthenticator.AuthDigest> algorithms)
Validate the parsed digest credentials against the request and configured algorithms.- Parameters:
request- HTTP requestalgorithms- Configured authentication algorithms- Returns:
trueif validation succeeded
-
isNonceStale
public boolean isNonceStale()
Check if the nonce has expired and is considered stale.- Returns:
trueif the nonce is stale
-
authenticate
public java.security.Principal authenticate(Realm realm)
Authenticate the user against the given realm using the parsed digest credentials.- Parameters:
realm- Realm to authenticate against- Returns:
- Principal if authentication succeeded,
nullotherwise
-
-