AuthProvider that provides GSSAPI authenticator instances for clients to connect to DSE clusters secured with the DseAuthenticator.

Constructor

new

DseGssapiAuthProvider

([Object gssOptions])

Creates a new instance of DseGssapiAuthProvider.

Examples:
const client = new cassandra.Client({
  contactPoints: ['h1', 'h2'],
  authProvider: new cassandra.auth.DseGssapiAuthProvider()
});
Parameters:
Name Type Description
gssOptions optional Object

GSSAPI authenticator options

gssOptions.authorizationId optional String

The optional authorization ID. Providing an authorization ID allows the currently authenticated user to act as a different user (a.k.a. proxy authentication).

gssOptions.service optional String

The service to use. Defaults to ‘dse’.

gssOptions.hostNameResolver optional function

A method to be used to resolve the name of the Cassandra node based on the IP Address. Defaults to lookupServiceResolver which resolves the FQDN of the provided IP to generate principals in the format of dse/example.com@MYREALM.COM. Alternatively, you can use reverseDnsResolver to do a reverse DNS lookup or useIpResolver to simply use the IP address provided.

gssOptions.user optional String

DEPRECATED, it will be removed in future versions. For proxy authentication, use authorizationId instead.

Methods

DseGssapiAuthProvider.lookupServiceResolver

(String ip, function callback)

Performs a lookupService query that resolves an IPv4 or IPv6 address to a hostname. This ultimately makes a getnameinfo() system call which depends on the OS to do hostname resolution.

Note: Depends on dns.lookupService which was added in 0.12. For older versions falls back on reverseDnsResolver.
Static
This function is static
Parameters:
Name Type Description
ip String

IP address to resolve.

callback function

The callback function with err and hostname arguments.

newAuthenticator

(String endpoint, String name)

Returns an Authenticator instance to be used by the driver when connecting to a host.

Parameters:
Name Type Description
endpoint String

The IP address and port number in the format ip:port.

name String

Authenticator name.

Returns:
Type Description
Authenticator

DseGssapiAuthProvider.reverseDnsResolver

(String ip, function callback)

Performs a reverse DNS query that resolves an IPv4 or IPv6 address to a hostname.

Static
This function is static
Parameters:
Name Type Description
ip String

IP address to resolve.

callback function

The callback function with err and hostname arguments.

DseGssapiAuthProvider.useIpResolver

(String ip, function callback)

Effectively a no op operation, returns the IP address provided.

Static
This function is static
Parameters:
Name Type Description
ip String

IP address to use.

callback function

The callback function with err and hostname arguments.