ManagedIdentityAppCredentials class
Managed Service Identity auth implementation.
- Extends
Constructors
Managed |
Managed Identity for AAD credentials auth and caching. |
Properties
o |
Gets the OAuth endpoint to use. Sets the OAuth endpoint to use. |
o |
Gets the OAuth scope to use. Sets the OAuth scope to use. |
Inherited Properties
app |
|
token |
Inherited Methods
get |
Gets an OAuth access token. |
is |
Checks if the service url is for a trusted host or not. |
sign |
Apply the credentials to the HTTP request. |
trust |
Adds the host of service url to trusted hosts. If expiration time is not provided, the expiration date will be current (utc) date + 1 day. |
Constructor Details
ManagedIdentityAppCredentials(string, string, IJwtTokenProviderFactory)
Managed Identity for AAD credentials auth and caching.
new ManagedIdentityAppCredentials(appId: string, oAuthScope: string, tokenProviderFactory: IJwtTokenProviderFactory)
Parameters
- appId
-
string
Client ID for the managed identity assigned to the bot.
- oAuthScope
-
string
The scope for the token.
- tokenProviderFactory
- IJwtTokenProviderFactory
The JWT token provider factory to use.
Property Details
oAuthEndpoint
Gets the OAuth endpoint to use. Sets the OAuth endpoint to use.
string oAuthEndpoint
Property Value
string
The OAuthEndpoint to use.
oAuthScope
Gets the OAuth scope to use. Sets the OAuth scope to use.
string oAuthScope
Property Value
string
The OAuth scope to use.
Inherited Property Details
appId
tokenCacheKey
Inherited Method Details
getToken(boolean)
Gets an OAuth access token.
function getToken(forceRefresh?: boolean): Promise<string>
Parameters
- forceRefresh
-
boolean
True to force a refresh of the token; or false to get a cached token if it exists.
Returns
Promise<string>
A Promise that represents the work queued to execute.
Remarks
If the promise is successful, the result contains the access token string.
Inherited From AppCredentials.getToken
isTrustedServiceUrl(string)
Warning
This API is now deprecated.
Checks if the service url is for a trusted host or not.
static function isTrustedServiceUrl(serviceUrl: string): boolean
Parameters
- serviceUrl
-
string
The service url
Returns
boolean
True if the host of the service url is trusted; False otherwise.
Inherited From AppCredentials.isTrustedServiceUrl
signRequest(WebResource)
Apply the credentials to the HTTP request.
function signRequest(webResource: WebResource): Promise<WebResource>
Parameters
- webResource
-
WebResource
The WebResource HTTP request.
Returns
Promise<WebResource>
A Promise representing the asynchronous operation.
Inherited From AppCredentials.signRequest
trustServiceUrl(string, Date)
Warning
This API is now deprecated.
Adds the host of service url to trusted hosts. If expiration time is not provided, the expiration date will be current (utc) date + 1 day.
static function trustServiceUrl(serviceUrl: string, expiration?: Date)
Parameters
- serviceUrl
-
string
The service url
- expiration
-
Date
Inherited From AppCredentials.trustServiceUrl