Top Description Fields Constructors Methods
org.apache.tomcat.websocket

public Class DigestAuthenticator

extends Authenticator
Class Inheritance
Imports
java.nio.charset.StandardCharsets, java.security.MessageDigest, .NoSuchAlgorithmException, .SecureRandom, java.util.Map, org.apache.tomcat.util.buf.HexUtils, org.apache.tomcat.util.res.StringManager

Authenticator supporting the DIGEST authentication method.

Field Summary

Modifier and TypeField and Description
private long
private static volatile SecureRandom
private static final Object
private int
public static final String
private static final StringManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
calculateRequestDigest(String requestUri, String userName, String password, String realm, String nonce, String qop, String algorithm)

private String
encode(String algorithm, String value)

public String
getAuthorization(String
The request URI
requestUri
,
String
The server authentication header received
authenticateHeader
,
String
The user name
userName
,
String
The user password
userPassword
,
String
The realm for which the provided user name and password are valid. null to indicate all realms.
userRealm
)

Implements abstract org.apache.tomcat.websocket.Authenticator.getAuthorization.

Generate the authorization header value that will be sent to the server.

public String
getSchemeName()

Implements abstract org.apache.tomcat.websocket.Authenticator.getSchemeName.

Get the authentication method.

Inherited from org.apache.tomcat.websocket.Authenticator:
parseAuthenticateHeadervalidatePasswordvalidateRealmvalidateUsername

Field Detail

cNonceback to summary
private long cNonce
cnonceGeneratorback to summary
private static volatile SecureRandom cnonceGenerator
cnonceGeneratorLockback to summary
private static final Object cnonceGeneratorLock
nonceCountback to summary
private int nonceCount
schemeNameback to summary
public static final String schemeName
smback to summary
private static final StringManager sm

Hides org.apache.tomcat.websocket.Authenticator.sm.

Constructor Detail

DigestAuthenticatorback to summary
public DigestAuthenticator()

Method Detail

calculateRequestDigestback to summary
private String calculateRequestDigest(String requestUri, String userName, String password, String realm, String nonce, String qop, String algorithm) throws NoSuchAlgorithmException
encodeback to summary
private String encode(String algorithm, String value) throws NoSuchAlgorithmException
getAuthorizationback to summary
public String getAuthorization(String requestUri, String authenticateHeader, String userName, String userPassword, String userRealm) throws AuthenticationException

Implements abstract org.apache.tomcat.websocket.Authenticator.getAuthorization.

Doc from org.apache.tomcat.websocket.Authenticator.getAuthorization.

Generate the authorization header value that will be sent to the server.

Parameters
requestUri:String

The request URI

authenticateHeader:String

The server authentication header received

userName:String

The user name

userPassword:String

The user password

userRealm:String

The realm for which the provided user name and password are valid. null to indicate all realms.

Returns:String

The generated authorization header value

Annotations
@Override
Exceptions
AuthenticationException:
When an error occurs
getSchemeNameback to summary
public String getSchemeName()

Implements abstract org.apache.tomcat.websocket.Authenticator.getSchemeName.

Doc from org.apache.tomcat.websocket.Authenticator.getSchemeName.

Get the authentication method.

Returns:String

the authentication scheme

Annotations
@Override