AuthProvider interface

Represents an authentication provider.

Properties

connectionSettings

The AuthConfiguration used for token acquisition.

getAgenticApplicationToken

Get an access token for the agentic application

getAgenticInstanceToken

Get an access token for the agentic instance

getAgenticUserToken

Get an access token for the agentic user

Methods

acquireTokenOnBehalfOf(AuthConfiguration | string[], string | string[], string)

Acquires a delegated token using explicit or provider-level settings.

acquireTokenOnBehalfOf(AuthConfiguration, string[], string)

Acquires a token on behalf of a user using explicit authentication settings.

acquireTokenOnBehalfOf(string[], string)

Acquires a token on behalf of a user using this provider's connection settings.

getAccessToken(AuthConfiguration, string)

Gets an access token for the specified authentication configuration and scope.

getAccessToken(string | AuthConfiguration, string)

Gets an access token using explicit or provider-level settings.

getAccessToken(string)

Gets an access token using this provider's connection settings.

Property Details

connectionSettings

The AuthConfiguration used for token acquisition.

connectionSettings?: AuthConfiguration

Property Value

getAgenticApplicationToken

Get an access token for the agentic application

getAgenticApplicationToken: (tenantId: string, agentAppInstanceId: string) => Promise<string>

Property Value

(tenantId: string, agentAppInstanceId: string) => Promise<string>

getAgenticInstanceToken

Get an access token for the agentic instance

getAgenticInstanceToken: (tenantId: string, agentAppInstanceId: string) => Promise<string>

Property Value

(tenantId: string, agentAppInstanceId: string) => Promise<string>

getAgenticUserToken

Get an access token for the agentic user

getAgenticUserToken: (tenantId: string, agentAppInstanceId: string, upn: string, scopes: string[]) => Promise<string>

Property Value

(tenantId: string, agentAppInstanceId: string, upn: string, scopes: string[]) => Promise<string>

Method Details

acquireTokenOnBehalfOf(AuthConfiguration | string[], string | string[], string)

Acquires a delegated token using explicit or provider-level settings.

function acquireTokenOnBehalfOf(authConfigOrScopes: AuthConfiguration | string[], scopesOrOboAssertion?: string | string[], oboAssertion?: string): Promise<string>

Parameters

authConfigOrScopes

AuthConfiguration | string[]

Authentication configuration, or requested scopes when using provider settings.

scopesOrOboAssertion

string | string[]

Requested scopes or the user assertion, depending on the overload.

oboAssertion

string

User assertion used with explicit authentication settings.

Returns

Promise<string>

A promise that resolves to the delegated access token.

acquireTokenOnBehalfOf(AuthConfiguration, string[], string)

Acquires a token on behalf of a user using explicit authentication settings.

function acquireTokenOnBehalfOf(authConfig: AuthConfiguration, scopes: string[], oboAssertion: string): Promise<string>

Parameters

authConfig
AuthConfiguration

Authentication configuration.

scopes

string[]

Scopes requested for the delegated token.

oboAssertion

string

User assertion exchanged for the token.

Returns

Promise<string>

A promise that resolves to the delegated access token.

acquireTokenOnBehalfOf(string[], string)

Acquires a token on behalf of a user using this provider's connection settings.

function acquireTokenOnBehalfOf(scopes: string[], oboAssertion: string): Promise<string>

Parameters

scopes

string[]

Scopes requested for the delegated token.

oboAssertion

string

User assertion exchanged for the token.

Returns

Promise<string>

A promise that resolves to the delegated access token.

getAccessToken(AuthConfiguration, string)

Gets an access token for the specified authentication configuration and scope.

function getAccessToken(authConfig: AuthConfiguration, scope: string): Promise<string>

Parameters

authConfig
AuthConfiguration

The authentication configuration.

scope

string

The scope for which the access token is requested.

Returns

Promise<string>

A promise that resolves to the access token.

getAccessToken(string | AuthConfiguration, string)

Gets an access token using explicit or provider-level settings.

function getAccessToken(authConfigOrScope: string | AuthConfiguration, scope?: string): Promise<string>

Parameters

authConfigOrScope

string | AuthConfiguration

Authentication configuration, or the scope when using provider settings.

scope

string

Scope used with an explicit authentication configuration.

Returns

Promise<string>

A promise that resolves to the access token.

getAccessToken(string)

Gets an access token using this provider's connection settings.

function getAccessToken(scope: string): Promise<string>

Parameters

scope

string

Scope for which the access token is requested.

Returns

Promise<string>

A promise that resolves to the access token.