Interface Authenticator

All Known Implementing Classes:
AuthenticatorWrapper, CertificateAuthenticator, DelegatingAuthenticator, JwtAuthenticator, PasswordAuthenticator

public interface Authenticator
An authentication strategy.

Note: The methods of this interface are part of the SDK's internal API, and may change at any time. Implementing this interface yourself is not recommended. Please use one of the provided implementations.

Since:
2.0.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    applyTlsProperties(com.couchbase.client.core.deps.io.netty.handler.ssl.SslContextBuilder sslContextBuilder)
    The authenticator gets the chance to attach the client certificate to the ssl context if needed.
    default void
    authHttpRequest(ServiceType serviceType, com.couchbase.client.core.deps.io.netty.handler.codec.http.HttpRequest request)
    Allows to add authentication credentials to the http request for the given service.
    default void
    authKeyValueConnection(EndpointContext endpointContext, com.couchbase.client.core.deps.io.netty.channel.ChannelPipeline pipeline)
    Allows the authenticator to add KV handlers during connection bootstrap to perform authentication.
    default String
    Returns the value of the Authorization header to apply to HTTP requests, or null if no header should be applied.
    Returns parameters for single-step SASL authentication refresh requests, or null if unsupported.
    default boolean
     
  • Method Details

    • authKeyValueConnection

      @Internal default void authKeyValueConnection(EndpointContext endpointContext, com.couchbase.client.core.deps.io.netty.channel.ChannelPipeline pipeline)
      Allows the authenticator to add KV handlers during connection bootstrap to perform authentication.
      Parameters:
      endpointContext - the endpoint context.
      pipeline - the pipeline when the endpoint is constructed.
    • authHttpRequest

      @Internal default void authHttpRequest(ServiceType serviceType, com.couchbase.client.core.deps.io.netty.handler.codec.http.HttpRequest request)
      Allows to add authentication credentials to the http request for the given service.
      Parameters:
      serviceType - the service for this request.
      request - the http request.
    • getAuthHeaderValue

      @Internal @Nullable default String getAuthHeaderValue()
      Returns the value of the Authorization header to apply to HTTP requests, or null if no header should be applied.
    • applyTlsProperties

      @Internal default void applyTlsProperties(com.couchbase.client.core.deps.io.netty.handler.ssl.SslContextBuilder sslContextBuilder)
      The authenticator gets the chance to attach the client certificate to the ssl context if needed.
      Parameters:
      sslContextBuilder - the netty context builder
    • requiresTls

      @Internal default boolean requiresTls()
    • getSingleStepSaslAuthParameters

      @Nullable default SingleStepSaslAuthParameters getSingleStepSaslAuthParameters()
      Returns parameters for single-step SASL authentication refresh requests, or null if unsupported.