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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAuthorization(String requestUri, String authenticateHeader, String userName, String userPassword, String userRealm) Deprecated.Unused.abstract StringgetAuthorization(String method, 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
-
Authenticator
public Authenticator()
-
-
Method Details
-
getAuthorization
@Deprecated public String getAuthorization(String requestUri, String authenticateHeader, String userName, String userPassword, String userRealm) throws AuthenticationException Deprecated.Unused. Will be remove in Tomcat 12. UsegetAuthorization(String, String, String, String, String, String)Generate the authorization header value that will be sent to the server.- Parameters:
requestUri- The request URIauthenticateHeader- The server authentication header receiveduserName- The usernameuserPassword- The user passworduserRealm- The realm for which the provided username and password are valid.nullto indicate all realms.- Returns:
- The generated authorization header value
- Throws:
AuthenticationException- When an error occurs
-
getAuthorization
public abstract String getAuthorization(String method, 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:
method- The request methodrequestUri- The request URIauthenticateHeader- The server authentication header receiveduserName- The usernameuserPassword- The user passworduserRealm- The realm for which the provided username and password are valid.nullto indicate all realms.- Returns:
- The generated authorization header value
- Throws:
AuthenticationException- When an error occurs
-
getSchemeName
Get the authentication method.- Returns:
- the authentication scheme
-
parseAuthenticateHeader
-
validateUsername
- Throws:
AuthenticationException
-
validatePassword
- Throws:
AuthenticationException
-
validateRealm
- Throws:
AuthenticationException
-