@Beta public abstract class Authenticator extends java.lang.Object
Authenticator is called when server-side returns HTTP 401 as a reply to handshake response. Tyrus client then looks for authenticator instance registered to authentication scheme provided by server.
AuthConfig.Builder.registerAuthProvider(String, Authenticator)
,
ClientProperties.AUTH_CONFIG
,
ClientProperties.CREDENTIALS
Constructor and Description |
---|
Authenticator() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
generateAuthorizationHeader(java.net.URI uri,
java.lang.String wwwAuthenticateHeader,
Credentials credentials)
Generate value used as "" header value for next request.
|
public abstract java.lang.String generateAuthorizationHeader(java.net.URI uri, java.lang.String wwwAuthenticateHeader, Credentials credentials) throws AuthenticationException
Thrown AuthenticationException
will be wrapped as DeploymentException
and thrown as a result of
WebSocketContainer
.connectToServer(...) method call.
uri
- Uri of the server endpoint.wwwAuthenticateHeader
- "" header value received in a handshake
response.credentials
- credentials passed by property ClientProperties.CREDENTIALS
. Can be null
when there were no Credentials
registered.AuthenticationException
- when it is not possible to create ""
header.Copyright © 2012–2020 Oracle Corporation. All rights reserved.