CertificateAppCredentials class
CertificateAppCredentials auth implementation
- Extends
Constructors
Certificate |
Initializes a new instance of the CertificateAppCredentials class. |
Properties
certificate |
|
certificate |
|
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
CertificateAppCredentials(string, string, string, string, string)
Initializes a new instance of the CertificateAppCredentials class.
new CertificateAppCredentials(appId: string, certificateThumbprint: string, certificatePrivateKey: string, channelAuthTenant?: string, oAuthScope?: string)
Parameters
- appId
-
string
Microsoft application Id related to the certificate.
- certificateThumbprint
-
string
A hex encoded thumbprint of the certificate.
- certificatePrivateKey
-
string
A PEM encoded certificate private key.
- channelAuthTenant
-
string
Optional. The oauth token tenant.
- oAuthScope
-
string
Optional. The scope for the token.
Property Details
certificatePrivateKey
certificatePrivateKey: string
Property Value
string
certificateThumbprint
certificateThumbprint: string
Property Value
string
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