MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / startAuthenticating

Method startAuthenticating

lib/connection.js:391–404  ·  view source on GitHub ↗

* Starts the SASL flow * @param {String} authenticatorName * @param {Function} callback

(authenticatorName, callback)

Source from the content-addressed store, hash-verified

389 * @param {Function} callback
390 */
391 startAuthenticating(authenticatorName, callback) {
392 if (!this.options.authProvider) {
393 return callback(new errors.AuthenticationError('Authentication provider not set'));
394 }
395 const authenticator = this.options.authProvider.newAuthenticator(this.endpoint, authenticatorName);
396 const self = this;
397 authenticator.initialResponse(function initialResponseCallback(err, token) {
398 // Start the flow with the initial token
399 if (err) {
400 return self.onAuthenticationError(callback, err);
401 }
402 self.authenticate(authenticator, token, callback);
403 });
404 }
405
406 /**
407 * Handles authentication requests and responses.

Callers 1

startupMethod · 0.80

Calls 4

authenticateMethod · 0.80
newAuthenticatorMethod · 0.65
initialResponseMethod · 0.65
onAuthenticationErrorMethod · 0.65

Tested by

no test coverage detected