Options
All
  • Public
  • Public/Protected
  • All
Menu

@azure/identity

Package version

Index

Type aliases

BrowserLoginStyle

BrowserLoginStyle: "redirect" | "popup"

The "login style" to use in the authentication flow:

  • "redirect" redirects the user to the authentication page and then redirects them back to the page once authentication is completed.
  • "popup" opens a new browser window through with the redirect flow is initiated. The user's existing browser window does not leave the current page

DeviceCodePromptCallback

DeviceCodePromptCallback: (deviceCodeInfo: DeviceCodeInfo) => void

Defines the signature of a callback which will be passed to DeviceCodeCredential for the purpose of displaying authentication details to the user.

Type declaration

Variables

Const AggregateAuthenticationErrorName

AggregateAuthenticationErrorName: "AggregateAuthenticationError" = "AggregateAuthenticationError"

The Error.name value of an AggregateAuthenticationError

Const AllSupportedEnvironmentVariables

AllSupportedEnvironmentVariables: string[] = ["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_USERNAME","AZURE_PASSWORD"]

Contains the list of all supported environment variable names so that an appropriate error message can be generated when no credentials can be configured.

internal

Const AppServiceMsiApiVersion

AppServiceMsiApiVersion: "2017-09-01" = "2017-09-01"

Const AuthenticationErrorName

AuthenticationErrorName: "AuthenticationError" = "AuthenticationError"

The Error.name value of an AuthenticationError

Const AzureAccountClientId

AzureAccountClientId: "aebc6443-996d-45c2-90f0-388ff96faa56" = "aebc6443-996d-45c2-90f0-388ff96faa56"

Const BrowserNotSupportedError

BrowserNotSupportedError: Error = new Error("getAuthorityHostEnvironment is not supported in the browser.")

Const CommonTenantId

CommonTenantId: "common" = "common"

Const DefaultAuthorityHost

DefaultAuthorityHost: "https://login.microsoftonline.com" = "https://login.microsoftonline.com"

Const DefaultScopeSuffix

DefaultScopeSuffix: "/.default" = "/.default"

Const ImdsApiVersion

ImdsApiVersion: "2018-02-01" = "2018-02-01"

Const ImdsEndpoint

ImdsEndpoint: "http://169.254.169.254/metadata/identity/oauth2/token" = "http://169.254.169.254/metadata/identity/oauth2/token"

Const SelfSignedJwtLifetimeMins

SelfSignedJwtLifetimeMins: 10 = 10

Const VSCodeUserName

VSCodeUserName: "VS Code Azure" = "VS Code Azure"

Const logger

logger: CredentialLogger = credentialLogger("VSCodeCredential")

The AzureLogger used for all clients within the identity package

Let testFunction

testFunction: ((t: number) => Promise<void>) | undefined

Functions

_setDelayTestFunction

  • _setDelayTestFunction(func?: undefined | ((t: number) => Promise<void>)): void

addMinutes

  • addMinutes(date: Date, minutes: number): Date

convertOAuthErrorResponseToErrorResponse

  • convertOAuthErrorResponseToErrorResponse(errorBody: OAuthErrorResponse): ErrorResponse

createSpan

  • createSpan(operationName: string, options?: GetTokenOptions): { options: GetTokenOptions; span: Span }
  • Creates a span using the global tracer.

    Parameters

    • operationName: string
    • Default value options: GetTokenOptions = {}

      The options for the underlying http request.

    Returns { options: GetTokenOptions; span: Span }

    • options: GetTokenOptions
    • span: Span

credentialLogger

  • Generates a CredentialLogger, which is a logger declared at the credential's constructor, and used at any point in the credential. It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.

    It logs with the format:

    [title] => [message] [title] => getToken() => [message]

    Parameters

    • title: string
    • Default value log: AzureLogger = logger

    Returns CredentialLogger

credentialLoggerInstance

delay

  • delay(t: number): Promise<void>

formatError

  • formatError(error: Error | string): string

formatSuccess

  • formatSuccess(scope: string | string[]): string

getAuthorityHostEnvironment

  • getAuthorityHostEnvironment(): undefined | { authorityHost: any }

getDefaultAzureCredential

  • getDefaultAzureCredential(): TokenCredential

getSafeWorkingDir

  • getSafeWorkingDir(): string

isErrorResponse

  • isErrorResponse(errorResponse: any): errorResponse is OAuthErrorResponse

logEnvVars

  • logEnvVars(credentialName: string, supportedEnvVars: string[]): void
  • Based on a given list of environment variable names, logs the environment variables currently assigned during the usage of a credential that goes by the given name.

    Parameters

    • credentialName: string

      Name of the credential in use

    • supportedEnvVars: string[]

      List of environment variables supported by that credential

    Returns void

processEnvVars

timestampInSeconds

  • timestampInSeconds(date: Date): number

Generated using TypeDoc