Editar

Compartilhar via


IConfidentialClientApplication interface

Interface for the ConfidentialClientApplication class defining the public API signatures

Methods

acquireTokenByClientCredential(ClientCredentialRequest)

Acquires tokens from the authority for the application (not for an end user)

acquireTokenByCode(AuthorizationCodeRequest)

Acquires a token by exchanging the authorization code received from the first step of OAuth 2.0 Authorization Code Flow

acquireTokenByRefreshToken(RefreshTokenRequest)

Acquires a token by exchanging the refresh token provided for a new set of tokens

acquireTokenByUsernamePassword(UsernamePasswordRequest)

Acquires tokens with password grant by exchanging client applications username and password for credentials

acquireTokenOnBehalfOf(OnBehalfOfRequest)

Acquires tokens from the authority for the application

acquireTokenSilent(SilentFlowRequest)

Acquires a token silently when a user specifies the account the token is requested for

clearCache()

Clear the cache

getAuthCodeUrl(AuthorizationUrlRequest)

Creates the URL of the authorization request

getLogger()

Returns the logger instance

getTokenCache()

Gets the token cache for the application

SetAppTokenProvider(IAppTokenProvider)

This extensibility point is meant for Azure SDK to enhance Managed Identity support

setLogger(Logger)

Replaces the default logger set in configurations with new Logger with new configurations

Method Details

acquireTokenByClientCredential(ClientCredentialRequest)

Acquires tokens from the authority for the application (not for an end user)

function acquireTokenByClientCredential(request: ClientCredentialRequest): Promise<AuthenticationResult | null>

Parameters

Returns

Promise<AuthenticationResult | null>

acquireTokenByCode(AuthorizationCodeRequest)

Acquires a token by exchanging the authorization code received from the first step of OAuth 2.0 Authorization Code Flow

function acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>

Parameters

Returns

Promise<AuthenticationResult>

acquireTokenByRefreshToken(RefreshTokenRequest)

Acquires a token by exchanging the refresh token provided for a new set of tokens

function acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>

Parameters

Returns

Promise<AuthenticationResult | null>

acquireTokenByUsernamePassword(UsernamePasswordRequest)

Acquires tokens with password grant by exchanging client applications username and password for credentials

function acquireTokenByUsernamePassword(request: UsernamePasswordRequest): Promise<AuthenticationResult | null>

Parameters

Returns

Promise<AuthenticationResult | null>

acquireTokenOnBehalfOf(OnBehalfOfRequest)

Acquires tokens from the authority for the application

function acquireTokenOnBehalfOf(request: OnBehalfOfRequest): Promise<AuthenticationResult | null>

Parameters

Returns

Promise<AuthenticationResult | null>

acquireTokenSilent(SilentFlowRequest)

Acquires a token silently when a user specifies the account the token is requested for

function acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult | null>

Parameters

Returns

Promise<AuthenticationResult | null>

clearCache()

Clear the cache

function clearCache()

getAuthCodeUrl(AuthorizationUrlRequest)

Creates the URL of the authorization request

function getAuthCodeUrl(request: AuthorizationUrlRequest): Promise<string>

Parameters

Returns

Promise<string>

getLogger()

Returns the logger instance

function getLogger(): Logger

Returns

Logger

getTokenCache()

Gets the token cache for the application

function getTokenCache(): TokenCache

Returns

SetAppTokenProvider(IAppTokenProvider)

This extensibility point is meant for Azure SDK to enhance Managed Identity support

function SetAppTokenProvider(provider: IAppTokenProvider)

Parameters

provider

IAppTokenProvider

setLogger(Logger)

Replaces the default logger set in configurations with new Logger with new configurations

function setLogger(logger: Logger)

Parameters

logger

Logger