Class: SASLSession

sazzle. SASLSession

Represents a single SASL authentication session.

The properties for this session are mostly mechanism-specific, although two values are expected to be present by the time this session is complete:

username
The authentiated user identifier.
authzid
The authorized user identifier.

new SASLSession(mech, config)

NOTE: This constructor should not be called directly. Instead, use SASLClientFactory.create.

Creates a new SASLSession with the given mechanism and configuration.

The argument {mech} defines the operations for this session. See sazzle.SASLFactory#register for details.

Parameters:
Name Type Argument Description
mech Object

The mechanism descriptor

config Object <optional>

The initial configuration

Properties:
Name Type Description
mechanism String

The name of the mechanism

properties Object

The session properties

completed Boolean

true if this session is done

Methods

step(input, encoding) → {Promise}

Performs the next step of the authentication session, including the first.

If {input} is a string, it is converted into a buffer based on the encoding (specfied by {encoding}).

The returned promise, when fulfilled, returns the data to send to the remote endpoint (as a Buffer).

Parameters:
Name Type Argument Default Description
input Buffer | String <optional>

The input data

encoding String <optional>
"base64"

The encoding of {input}, if it is a string

Throws:
if {input} is not null, a string, or a Buffer
Type
TypeError
Returns:

The result of processing the step

Type
Promise
Copyright © 2012-2014, Matthew A. Miller
Documentation generated by JSDoc 3.2.2 on 2014-12-04T09:26:34-07:00 using the DocStrap template.