Top Description Constructors Methods
org.glassfish.tyrus.client.auth

pack-priv final Class BasicAuthenticator

extends Authenticator
Class Inheritance
Imports
java.net.URI, java.util.Base64, org.glassfish.tyrus.core.l10n.LocalizationMessages

Generates a value of Authorization header of HTTP request for Basic Http Authentication scheme.
Author
Ondrej Kosatka

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String
generateAuthorizationHeader(final URI
Uri of the server endpoint.
uri
,
final String
"WWW-Authenticate" header value received in a handshake response.
wwwAuthenticateHeader
,
final Credentials
credentials passed by property ClientProperties#CREDENTIALS. Can be null when there were no Credentials registered.
credentials
)

Implements abstract org.glassfish.tyrus.client.auth.Authenticator.generateAuthorizationHeader.

Generate value used as "Authorization" header value for next request.

private String

Constructor Detail

BasicAuthenticatorback to summary
pack-priv BasicAuthenticator()

Method Detail

generateAuthorizationHeaderback to summary
public String generateAuthorizationHeader(final URI uri, final String wwwAuthenticateHeader, final Credentials credentials) throws AuthenticationException

Implements abstract org.glassfish.tyrus.client.auth.Authenticator.generateAuthorizationHeader.

Doc from org.glassfish.tyrus.client.auth.Authenticator.generateAuthorizationHeader.

Generate value used as "Authorization" header value for next request.

Thrown AuthenticationException will be wrapped as DeploymentException and thrown as a result of WebSocketContainer.connectToServer(...) method call.

Parameters
uri:URI

Uri of the server endpoint.

wwwAuthenticateHeader:String

"WWW-Authenticate" header value received in a handshake response.

credentials:Credentials

credentials passed by property ClientProperties#CREDENTIALS. Can be null when there were no Credentials registered.

Returns:String

value for Authorization header which will be put into next handshake request.

Annotations
@Override
Exceptions
AuthenticationException:
when it is not possible to create "Authorization" header.
generateAuthorizationHeaderback to summary
private String generateAuthorizationHeader(final Credentials credentials) throws AuthenticationException