Package org.apache.tomcat.websocket
Class Authenticator
java.lang.Object
org.apache.tomcat.websocket.Authenticator
- Direct Known Subclasses:
- BasicAuthenticator,- DigestAuthenticator
Base class for the authentication methods used by the WebSocket client.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract StringgetAuthorization(String requestUri, String authenticateHeader, String userName, String userPassword, String userRealm) Generate the authorization header value that will be sent to the server.abstract StringGet the authentication method.parseAuthenticateHeader(String authenticateHeader) Utility method to parse the authentication header.protected voidvalidatePassword(String password) protected voidvalidateRealm(String userRealm, String serverRealm) protected voidvalidateUsername(String userName) 
- 
Constructor Details- 
Authenticatorpublic Authenticator()
 
- 
- 
Method Details- 
getAuthorizationpublic 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- The request URI
- authenticateHeader- The server authentication header received
- userName- The user name
- userPassword- The user password
- userRealm- The realm for which the provided user name and password are valid.- nullto indicate all realms.
- Returns:
- The generated authorization header value
- Throws:
- AuthenticationException- When an error occurs
 
- 
getSchemeNameGet the authentication method.- Returns:
- the authentication scheme
 
- 
parseAuthenticateHeaderUtility method to parse the authentication header.- Parameters:
- authenticateHeader- The server authenticate header received
- Returns:
- a map of authentication parameter names and values
 
- 
validateUsername- Throws:
- AuthenticationException
 
- 
validatePassword- Throws:
- AuthenticationException
 
- 
validateRealm- Throws:
- AuthenticationException
 
 
-