MicrosoftAppCredentials class

MicrosoftAppCredentials auth implementation

Extends

Constructors

MicrosoftAppCredentials(string, string, string, string)

Initializes a new instance of the MicrosoftAppCredentials class.

Properties

appPassword
Empty

An empty set of credentials.

oAuthEndpoint

Gets the OAuth endpoint to use. Sets the OAuth endpoint to use.

oAuthScope

Gets the OAuth scope to use. Sets the OAuth scope to use.

Inherited Properties

appId
tokenCacheKey

Inherited Methods

getToken(boolean)

Gets an OAuth access token.

isTrustedServiceUrl(string)

Checks if the service url is for a trusted host or not.

signRequest(WebResource)

Apply the credentials to the HTTP request.

trustServiceUrl(string, Date)

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

MicrosoftAppCredentials(string, string, string, string)

Initializes a new instance of the MicrosoftAppCredentials class.

new MicrosoftAppCredentials(appId: string, appPassword: string, channelAuthTenant?: string, oAuthScope?: string)

Parameters

appId

string

The Microsoft app ID.

appPassword

string

The Microsoft app password.

channelAuthTenant

string

Optional. The oauth token tenant.

oAuthScope

string

Optional. The scope for the token.

Property Details

appPassword

appPassword: string

Property Value

string

Empty

An empty set of credentials.

static Empty: MicrosoftAppCredentials

Property Value

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

appId: string

Property Value

string

Inherited From AppCredentials.appId

tokenCacheKey

tokenCacheKey: string

Property Value

string

Inherited From AppCredentials.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