Condividi tramite


TokenCredentialsBase class

Costruttori

TokenCredentialsBase(string, string, string, Environment, TokenCache)

Proprietà

authContext
clientId
domain
environment
tokenAudience
tokenCache

Metodi

getToken()

Prova a ottenere il token dalla cache inizialmente. Se non riesce, prova a ottenere il token da ADAL.

setDomain(string)
signRequest(WebResource)

Firma una richiesta con l'intestazione Autenticazione.

Dettagli costruttore

TokenCredentialsBase(string, string, string, Environment, TokenCache)

new TokenCredentialsBase(clientId: string, domain: string, tokenAudience?: string, environment?: Environment, tokenCache?: TokenCache)

Parametri

clientId

string

domain

string

tokenAudience

string

environment
Environment
tokenCache

TokenCache

Dettagli proprietà

authContext

authContext: AuthenticationContext

Valore della proprietà

AuthenticationContext

clientId

clientId: string

Valore della proprietà

string

domain

domain: string

Valore della proprietà

string

environment

environment: Environment

Valore della proprietà

tokenAudience

tokenAudience?: string

Valore della proprietà

string

tokenCache

tokenCache: TokenCache

Valore della proprietà

TokenCache

Dettagli metodo

getToken()

Prova a ottenere il token dalla cache inizialmente. Se non riesce, prova a ottenere il token da ADAL.

function getToken(): Promise<TokenResponse>

Restituisce

Promise<TokenResponse>

Il tokenResponse (tokenType e accessToken sono le due proprietà importanti).

setDomain(string)

function setDomain(domain: string)

Parametri

domain

string

signRequest(WebResource)

Firma una richiesta con l'intestazione Autenticazione.

function signRequest(webResource: WebResource): Promise<WebResource>

Parametri

webResource
WebResource

WebResource da firmare.

Restituisce

Promise<WebResource>