TokenCredentialsBase class
Properties
| auth |
|
| client |
|
| domain | |
| environment | |
| token |
|
| token |
Methods
| get |
Tries to get the token from cache initially. If that is unsuccessful then it tries to get the token from ADAL. |
| set |
|
| sign |
Signs a request with the Authentication header. |
Constructor Details
TokenCredentialsBase(string, string, string, Environment, TokenCache)
new TokenCredentialsBase(clientId: string, domain: string, tokenAudience?: string, environment?: Environment, tokenCache?: TokenCache)
Parameters
- clientId
-
string
- domain
-
string
- tokenAudience
-
string
- environment
- Environment
- tokenCache
-
TokenCache
Property Details
authContext
authContext: AuthenticationContext
Property Value
AuthenticationContext
clientId
clientId: string
Property Value
string
domain
domain: string
Property Value
string
environment
tokenAudience
tokenAudience?: string
Property Value
string
tokenCache
tokenCache: TokenCache
Property Value
TokenCache
Method Details
getToken()
Tries to get the token from cache initially. If that is unsuccessful then it tries to get the token from ADAL.
function getToken(): Promise<TokenResponse>
Returns
Promise<TokenResponse>
The tokenResponse (tokenType and accessToken are the two important properties).
setDomain(string)
function setDomain(domain: string)
Parameters
- domain
-
string
signRequest(WebResource)
Signs a request with the Authentication header.
function signRequest(webResource: WebResource): Promise<WebResource>
Parameters
- webResource
- WebResource
The WebResource to be signed.
Returns
Promise<WebResource>