adal-node package

Classes

AuthenticationContext
AuthenticationParameters
Logging
MemoryCache
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 "LoggingLevel" is a type alias. It refers to 0, 1, 2 and 3.

Interfaces

ErrorResponse

This will be returned in case the OAuth 2 service returns an error.

LoggingOptions
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.

Functions

createAuthenticationContext

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

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

createAuthenticationParametersFromResponse

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

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

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?: boolean)
Parameters
authority
string

A URL that identifies a token authority.

validateAuthority
boolean
Returns

createAuthenticationParametersFromHeader

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

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

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?: string)
Parameters
url
string

The url of a resource server.

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

Called on error or request completion.

correlationId
string
Returns

getGlobalADALOptions

function getGlobalADALOptions()
Returns
any

setGlobalADALOptions

function setGlobalADALOptions()
Returns
any