adal-node package

Classes

AuthenticationContext
AuthenticationParameters
Logging
MemoryCache

Interfaces

ErrorResponse

{string} [errorDescription] A description of the error returned.

LoggingOptions

{boolean} [loggingWithPII] This value indicts if personal identity related information such as token and claims should be logged. The default value is false.

TokenCache

This is an interface that can be implemented to provide custom token cache persistence.

TokenResponse

Contains tokens and metadata upon successful completion of an acquireToken call.

UserCodeInfo

Describes the user code information that is provided by ADAL while authenticating via DeviceCode.

Type Aliases

AcquireTokenCallback

This is the callback that is passed to all acquireToken variants below.

AcquireUserCodeCallback

This is the callback that is passed to all acquireUserCode method below.

LoggingCallback
LoggingLevel

Describes the available logging levels. ERROR: 0, WARN: 1, INFO: 2, VERBOSE: 3

Functions

createAuthenticationContext(string, undefined | false | true)

Creates a new AuthenticationContext object. By default the authority will be checked against a list of known Azure Active Directory authorities. If the authority is not recognized as one of these well known authorities then token acquisition will fail. This behavior can be turned off via the validateAuthority parameter below.

createAuthenticationParametersFromHeader(string)

Creates an <xref:AuthenticationParameters> object from the contents of a www-authenticate header received from a HTTP 401 response from a resource server.

createAuthenticationParametersFromResponse(IncomingMessage)

Create an <xref:AuthenticationParameters> object from a node http.IncomingMessage object that was created as a result of a request to a resource server. This function expects the response to contain a HTTP 401 error code with a www-authenticate header.

createAuthenticationParametersFromUrl(string, (error: Error, parameters: AuthenticationParameters) => void, undefined | string)

Creates an <xref:AuthenticationParameters> object by sending a get request to the url passed to this function, and parsing the resulting http 401 response.

getGlobalADALOptions()
setGlobalADALOptions()

Function Details

createAuthenticationContext(string, undefined | false | true)

Creates a new AuthenticationContext object. By default the authority will be checked against a list of known Azure Active Directory authorities. If the authority is not recognized as one of these well known authorities then token acquisition will fail. This behavior can be turned off via the validateAuthority parameter below.

function createAuthenticationContext(authority: string, validateAuthority?: undefined | false | true)

Parameters

authority
string

A URL that identifies a token authority.

validateAuthority
undefined | false | true

Returns

createAuthenticationParametersFromHeader(string)

Creates an <xref:AuthenticationParameters> object from the contents of a www-authenticate header received from a HTTP 401 response from a resource server.

function createAuthenticationParametersFromHeader(challenge: string)

Parameters

challenge
string

The content fo the www-authenticate header.

Returns

createAuthenticationParametersFromResponse(IncomingMessage)

Create an <xref:AuthenticationParameters> object from a node http.IncomingMessage object that was created as a result of a request to a resource server. This function expects the response to contain a HTTP 401 error code with a www-authenticate header.

function createAuthenticationParametersFromResponse(response: IncomingMessage)

Parameters

response
IncomingMessage

A response from a http request to a resource server.

Returns

createAuthenticationParametersFromUrl(string, (error: Error, parameters: AuthenticationParameters) => void, undefined | string)

Creates an <xref:AuthenticationParameters> object by sending a get request to the url passed to this function, and parsing the resulting http 401 response.

function createAuthenticationParametersFromUrl(url: string, callback: (error: Error, parameters: AuthenticationParameters) => void, correlationId?: undefined | string)

Parameters

url
string

The url of a resource server.

callback
(error: Error, parameters: AuthenticationParameters) => void

Called on error or request completion.

correlationId
undefined | string

Returns

getGlobalADALOptions()

function getGlobalADALOptions()

Returns

any

setGlobalADALOptions()

function setGlobalADALOptions()

Returns

any