Options
All
  • Public
  • Public/Protected
  • All
Menu

@azure/identity

Package version

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

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: Object = ["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: any = 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"

Let keytar

keytar: any

Const logger

logger: CredentialLogger = credentialLogger("VisualStudioCodeCredential")

The AzureLogger used for all clients within the identity package

Functions

addMinutes

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

checkUnsupportedTenant

  • checkUnsupportedTenant(tenantId: string): void

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

defaultDeviceCodePromptCallback

  • defaultDeviceCodePromptCallback(deviceCodeInfo: DeviceCodeInfo): void

formatError

  • formatError(error: Error | string): string
  • Formatting the success event on the credentials

    Parameters

    • error: Error | string

    Returns string

formatSuccess

  • formatSuccess(scope: string | string[]): string
  • Formatting the success event on the credentials

    Parameters

    • scope: string | string[]

    Returns string

getAuthorityHostEnvironment

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

getDefaultAzureCredential

  • getDefaultAzureCredential(): TokenCredential

getIdentityTokenEndpointSuffix

  • getIdentityTokenEndpointSuffix(tenantId: string): string

getPropertyFromVSCode

  • getPropertyFromVSCode(property: string): string | undefined
  • Attempts to load a specific property from the VSCode configurations of the current OS. If it fails at any point, returns undefined.

    Parameters

    • property: string

    Returns string | undefined

getSafeWorkingDir

  • getSafeWorkingDir(): string

isErrorResponse

  • isErrorResponse(errorResponse: any): errorResponse is OAuthErrorResponse
  • Parameters

    • errorResponse: any

    Returns 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

  • Separates a list of environment variable names into a plain object with two arrays: an array of missing environment variables and another array with assigned environment variables.

    Parameters

    • supportedEnvVars: string[]

      List of environment variable names

    Returns EnvironmentAccumulator

timestampInSeconds

  • timestampInSeconds(date: Date): number

Object literals

Const unsupportedTenantIds

unsupportedTenantIds: object

adfs

adfs: string = "The VisualStudioCodeCredential does not support authentication with ADFS tenants."

Generated using TypeDoc