Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Class PasswordAuthenticator

Authenticator using username and password credentials. Uses SASL for KV connections and HTTP Basic authentication for HTTP requests.

Inheritance
object
BaseAuthenticator
PasswordAuthenticator
Implements
IAuthenticator
Inherited Members
BaseAuthenticator.GetClientCertificates(ILogger<object>)
BaseAuthenticator.AuthenticateHttpHandler(HttpMessageHandler, ClusterOptions, ICertificateValidationCallbackFactory, ILogger<object>)
BaseAuthenticator.AuthenticateSslStream(SslStream, string, ClusterOptions, ICertificateValidationCallbackFactory, CancellationToken, ILogger<object>)
object.GetType()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Couchbase.Core.IO.Authentication.Authenticators
Assembly: Couchbase.NetClient.dll
Syntax
public sealed class PasswordAuthenticator : BaseAuthenticator, IAuthenticator

Constructors

View Source

PasswordAuthenticator(string, string, bool)

Creates a new PasswordAuthenticator with the specified credentials.

Declaration
public PasswordAuthenticator(string username, string password, bool enableTls = true)
Parameters
Type Name Description
string username

The username.

string password

The password.

bool enableTls

Whether TLS is enabled (affects SASL mechanism selection).

Fields

View Source

Password

Declaration
public readonly string Password
Field Value
Type Description
string
View Source

Username

Declaration
public readonly string Username
Field Value
Type Description
string

Properties

View Source

AuthenticatorType

Allows for easier type checking of authenticators without incurring the overhead of type checking against its concrete class.

Declaration
public override AuthenticatorType AuthenticatorType { get; }
Property Value
Type Description
AuthenticatorType
Overrides
BaseAuthenticator.AuthenticatorType
View Source

CanReauthenticateKv

Determines whether this authenticator can be used to re-authenticate existing KV connections. E.g. JWT authenticator should re-authenticate existing KV connections when the token is refreshed, while the password and certificate authenticators leave existing connections untouched.

Declaration
public override bool CanReauthenticateKv { get; }
Property Value
Type Description
bool
Overrides
BaseAuthenticator.CanReauthenticateKv
View Source

SupportsNonTls

Indicates whether this authenticator supports non-TLS connections.

Declaration
public override bool SupportsNonTls { get; }
Property Value
Type Description
bool
Overrides
BaseAuthenticator.SupportsNonTls
View Source

SupportsTls

Indicates whether this authenticator supports TLS connections.

Declaration
public override bool SupportsTls { get; }
Property Value
Type Description
bool
Overrides
BaseAuthenticator.SupportsTls

Methods

View Source

AuthenticateClientWebSocket(ClientWebSocket)

Takes a ClientWebSocket and applies authentication (e.g., setting headers).

Declaration
public override void AuthenticateClientWebSocket(ClientWebSocket clientWebSocket)
Parameters
Type Name Description
ClientWebSocket clientWebSocket

A ClientWebSocket object.

Overrides
BaseAuthenticator.AuthenticateClientWebSocket(ClientWebSocket)
View Source

AuthenticateGrpcMetadata(Metadata)

Adds authentication header for Stellar gRPC calls.

Declaration
public override void AuthenticateGrpcMetadata(Metadata metadata)
Parameters
Type Name Description
Metadata metadata

Metadata to add to gRPC messages

Overrides
BaseAuthenticator.AuthenticateGrpcMetadata(Metadata)
View Source

AuthenticateHttpRequest(HttpRequestMessage)

Adds authentication to an HTTP request (e.g., Authorization header).

Declaration
public override void AuthenticateHttpRequest(HttpRequestMessage request)
Parameters
Type Name Description
HttpRequestMessage request

The HTTP request to authenticate.

Overrides
BaseAuthenticator.AuthenticateHttpRequest(HttpRequestMessage)

Implements

IAuthenticator
  • View Source
In this article
Back to top Copyright © 2020 Couchbase, Inc. All rights reserved.