Class JwtAuthenticator

java.lang.Object
com.couchbase.client.core.env.JwtAuthenticator
All Implemented Interfaces:
Authenticator

@SinceCouchbase("8.1") @NullMarked public class JwtAuthenticator extends Object implements Authenticator
Authenticates with the Couchbase Server cluster using a JSON Web Token (JWT) issued by an Identity Provider.

Create a new instance by calling create(String).

  • Method Details

    • create

      public static JwtAuthenticator create(String jwt)
    • authKeyValueConnection

      public void authKeyValueConnection(EndpointContext ctx, com.couchbase.client.core.deps.io.netty.channel.ChannelPipeline pipeline)
      Description copied from interface: Authenticator
      Allows the authenticator to add KV handlers during connection bootstrap to perform authentication.
      Specified by:
      authKeyValueConnection in interface Authenticator
      Parameters:
      ctx - the endpoint context.
      pipeline - the pipeline when the endpoint is constructed.
    • getSingleStepSaslAuthParameters

      public SingleStepSaslAuthParameters getSingleStepSaslAuthParameters()
      Description copied from interface: Authenticator
      Returns parameters for single-step SASL authentication refresh requests, or null if unsupported.
      Specified by:
      getSingleStepSaslAuthParameters in interface Authenticator
    • getAuthHeaderValue

      public String getAuthHeaderValue()
      Description copied from interface: Authenticator
      Returns the value of the Authorization header to apply to HTTP requests, or null if no header should be applied.
      Specified by:
      getAuthHeaderValue in interface Authenticator
    • toString

      public String toString()
      Overrides:
      toString in class Object