Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "Configuration"

Index

Type aliases

AuthOptions

AuthOptions: object
type

AuthOptions: Use this to configure the auth options in the Configuration object

  • clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform
  • authority - You can configure a specific authority, defaults to " " or "https://login.microsoftonline.com/common"
  • validateAuthority - Used to turn authority validation on/off. When set to true (default), MSAL will compare the application's authority against well-known URLs templates representing well-formed authorities. It is useful when the authority is obtained at run time to prevent MSAL from displaying authentication prompts from malicious pages.
  • redirectUri - The redirect URI of the application, this should be same as the value in the application registration portal.Defaults to window.location.href.
  • postLogoutRedirectUri - Used to redirect the user to this location after logout. Defaults to window.location.href.
  • navigateToLoginRequestUrl - Used to turn off default navigation to start page after login. Default is true. This is used only for redirect flows.

Type declaration

  • Optional authority?: string
  • clientId: string
  • Optional navigateToLoginRequestUrl?: boolean
  • Optional postLogoutRedirectUri?: string | function
  • Optional redirectUri?: string | function
  • Optional validateAuthority?: boolean

CacheLocation

CacheLocation: "localStorage" | "sessionStorage"

Cache location options supported by MSAL are:

  • local storage: MSAL uses browsers local storage to store its cache
  • session storage: MSAL uses the browsers session storage to store its cache

CacheOptions

CacheOptions: object

Use this to configure the below cache configuration options:

  • cacheLocation - Used to specify the cacheLocation user wants to set. Valid values are "localStorage" and "sessionStorage"
  • storeAuthStateInCookie - If set, MSAL store's the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.

Type declaration

  • Optional cacheLocation?: CacheLocation
  • Optional storeAuthStateInCookie?: boolean

Configuration

Configuration: object

Use the configuration object to configure MSAL and initialize the UserAgentApplication.

This object allows you to configure important elements of MSAL functionality:

  • auth: this is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform
  • cache: this is where you configure cache location and whether to store cache in cookies
  • system: this is where you can configure the logger, frame timeout etc.
  • framework: this is where you can configure the running mode of angular. More to come here soon.

Type declaration

FrameworkOptions

FrameworkOptions: object

App/Framework specific environment support

  • isAngular - flag set to determine if it is Angular Framework. MSAL uses this to broadcast tokens. More to come here: detangle this dependency from core.
  • unprotectedResources - Array of URI's which are unprotected resources. MSAL will not attach a token to outgoing requests that have these URI. Defaults to 'null'.
  • protectedResourceMap - This is mapping of resources to scopes used by MSAL for automatically attaching access tokens in web API calls.A single access token is obtained for the resource. So you can map a specific resource path as follows: {"https://graph.microsoft.com/v1.0/me", ["user.read"]}, or the app URL of the resource as: {"https://graph.microsoft.com/", ["user.read", "mail.send"]}. This is required for CORS calls.

Type declaration

  • Optional isAngular?: boolean
  • Optional protectedResourceMap?: Map<string, Array<string>>
  • Optional unprotectedResources?: Array<string>

SystemOptions

SystemOptions: object

Library Specific Options

  • logger - Used to initialize the Logger object; TODO: Expand on logger details or link to the documentation on logger
  • loadFrameTimeout - maximum time the library should wait for a frame to load
  • tokenRenewalOffsetSeconds - sets the window of offset needed to renew the token before expiry
  • navigateFrameWait - sets the wait time for hidden iFrame navigation

Type declaration

  • Optional loadFrameTimeout?: number
  • Optional logger?: Logger
  • Optional navigateFrameWait?: number
  • Optional telemetry?: TelemetryOptions
  • Optional tokenRenewalOffsetSeconds?: number

TelemetryOptions

TelemetryOptions: object

Telemetry Config Options

  • applicationName - Name of the consuming apps application
  • applicationVersion - Verison of the consuming application
  • telemetryEmitter - Function where telemetry events are flushed to

Type declaration

  • applicationName: string
  • applicationVersion: string
  • telemetryEmitter: TelemetryEmitter

Variables

Const FRAME_TIMEOUT

FRAME_TIMEOUT: 6000 = 6000

Defaults for the Configuration Options

Const NAVIGATE_FRAME_WAIT

NAVIGATE_FRAME_WAIT: 500 = 500

Const OFFSET

OFFSET: 300 = 300

Functions

buildConfiguration

  • MSAL function that sets the default options when not explicitly configured from app developer

    Parameters

    • __namedParameters: object
      • auth: object
        • Optional authority?: string
        • clientId: string
        • Optional navigateToLoginRequestUrl?: boolean
        • Optional postLogoutRedirectUri?: string | function
        • Optional redirectUri?: string | function
        • Optional validateAuthority?: boolean
      • cache: object
        • Optional cacheLocation?: CacheLocation
        • Optional storeAuthStateInCookie?: boolean
      • framework: object
        • Optional isAngular?: boolean
        • Optional protectedResourceMap?: Map<string, Array<string>>
        • Optional unprotectedResources?: Array<string>
      • system: object
        • Optional loadFrameTimeout?: number
        • Optional logger?: Logger
        • Optional navigateFrameWait?: number
        • Optional telemetry?: TelemetryOptions
        • Optional tokenRenewalOffsetSeconds?: number

    Returns Configuration

    TConfiguration object

Object literals

Const DEFAULT_AUTH_OPTIONS

DEFAULT_AUTH_OPTIONS: object

authority

authority: null = null

clientId

clientId: string = ""

navigateToLoginRequestUrl

navigateToLoginRequestUrl: true = true

validateAuthority

validateAuthority: true = true

postLogoutRedirectUri

  • postLogoutRedirectUri(): string
  • Returns string

redirectUri

  • redirectUri(): string
  • Returns string

Const DEFAULT_CACHE_OPTIONS

DEFAULT_CACHE_OPTIONS: object

cacheLocation

cacheLocation: "sessionStorage" = "sessionStorage"

storeAuthStateInCookie

storeAuthStateInCookie: false = false

Const DEFAULT_FRAMEWORK_OPTIONS

DEFAULT_FRAMEWORK_OPTIONS: object

isAngular

isAngular: false = false

protectedResourceMap

protectedResourceMap: Map<string, string[]> = new Map<string, Array<string>>()

unprotectedResources

unprotectedResources: string[] = new Array<string>()

Const DEFAULT_SYSTEM_OPTIONS

DEFAULT_SYSTEM_OPTIONS: object

loadFrameTimeout

loadFrameTimeout: number = FRAME_TIMEOUT

logger

logger: Logger = new Logger(null)

navigateFrameWait

navigateFrameWait: number = NAVIGATE_FRAME_WAIT

tokenRenewalOffsetSeconds

tokenRenewalOffsetSeconds: number = OFFSET

Generated using TypeDoc