ManagedIdentityAppCredentials class
受控服務識別驗證實作。
- Extends
建構函式
| Managed |
AAD 認證驗證和快取的受控識別。 |
屬性
| o |
取得要使用的 OAuth 端點。 設定要使用的 OAuth 端點。 |
| o |
取得要使用的 OAuth 範圍。 設定要使用的 OAuth 範圍。 |
繼承的屬性
| app |
|
| token |
繼承的方法
| get |
取得 OAuth 存取令牌。 |
| is |
檢查服務 URL 是否為受信任的主機。 |
| sign |
將認證套用至 HTTP 要求。 |
| trust |
將服務 URL 的主機新增至信任的主機。 如果未提供到期時間,到期日將是目前 (utc) 日期 + 1 天。 |
建構函式詳細資料
ManagedIdentityAppCredentials(string, string, IJwtTokenProviderFactory)
AAD 認證驗證和快取的受控識別。
new ManagedIdentityAppCredentials(appId: string, oAuthScope: string, tokenProviderFactory: IJwtTokenProviderFactory)
參數
- appId
-
string
指派給 Bot 之受控識別的用戶端標識碼。
- oAuthScope
-
string
令牌的範圍。
- tokenProviderFactory
- IJwtTokenProviderFactory
要使用的 JWT 令牌提供者處理站。
屬性詳細資料
oAuthEndpoint
取得要使用的 OAuth 端點。 設定要使用的 OAuth 端點。
string oAuthEndpoint
屬性值
string
要使用的 OAuthEndpoint。
oAuthScope
取得要使用的 OAuth 範圍。 設定要使用的 OAuth 範圍。
string oAuthScope
屬性值
string
要使用的 OAuth 範圍。
繼承的屬性詳細資料
appId
tokenCacheKey
繼承的方法的詳細資料
getToken(boolean)
取得 OAuth 存取令牌。
function getToken(forceRefresh?: boolean): Promise<string>
參數
- forceRefresh
-
boolean
True 是表示 強制重新整理令牌;如果存在快取令牌,則為 false。
傳回
Promise<string>
Promise,表示要執行的工作佇列。
備註
如果承諾成功,結果會包含存取令牌字串。
isTrustedServiceUrl(string)
警告
此 API 現已淘汰。
檢查服務 URL 是否為受信任的主機。
static function isTrustedServiceUrl(serviceUrl: string): boolean
參數
- serviceUrl
-
string
服務 URL
傳回
boolean
如果信任服務 URL 的主機,則為 True;否則為 False。
signRequest(WebResource)
將認證套用至 HTTP 要求。
function signRequest(webResource: WebResource): Promise<WebResource>
參數
- webResource
-
WebResource
WebResource HTTP 要求。
傳回
Promise<WebResource>
代表異步操作的 Promise。
trustServiceUrl(string, Date)
警告
此 API 現已淘汰。
將服務 URL 的主機新增至信任的主機。 如果未提供到期時間,到期日將是目前 (utc) 日期 + 1 天。
static function trustServiceUrl(serviceUrl: string, expiration?: Date)
參數
- serviceUrl
-
string
服務 URL
- expiration
-
Date