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

public abstract Class Authenticator

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.tomcat.websocket.BasicAuthenticator, org.apache.tomcat.websocket.DigestAuthenticator
Imports
java.util.HashMap, .Map, java.util.regex.Matcher, .Pattern, org.apache.tomcat.util.res.StringManager

Base class for the authentication methods used by the WebSocket client.

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final StringManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract String

Returns:

The generated authorization header value
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
)

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

public abstract String

Returns:

the authentication scheme
getSchemeName
()

Get the authentication method.

public Map<String, String>

Returns:

a map of authentication parameter names and values
parseAuthenticateHeader
(String
The server authenticate header received
authenticateHeader
)

Utility method to parse the authentication header.

protected void
protected void
validateRealm(String userRealm, String serverRealm)

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

patternback to summary
private static final Pattern pattern
smback to summary
private static final StringManager sm

Constructor Detail

Authenticatorback to summary
public Authenticator()

Method Detail

getAuthorizationback to summary
public abstract String getAuthorization(String requestUri, String authenticateHeader, String userName, String userPassword, String userRealm) throws AuthenticationException

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

Exceptions
AuthenticationException:
When an error occurs
getSchemeNameback to summary
public abstract String getSchemeName()

Get the authentication method.

Returns:String

the authentication scheme

parseAuthenticateHeaderback to summary
public Map<String, String> parseAuthenticateHeader(String authenticateHeader)

Utility method to parse the authentication header.

Parameters
authenticateHeader:String

The server authenticate header received

Returns:Map<String, String>

a map of authentication parameter names and values

validatePasswordback to summary
protected void validatePassword(String password) throws AuthenticationException
validateRealmback to summary
protected void validateRealm(String userRealm, String serverRealm) throws AuthenticationException
validateUsernameback to summary
protected void validateUsername(String userName) throws AuthenticationException