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 inputBuffer | String <optional>
The input data
encodingString <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
-