次の方法で共有


MSITokenCredentials class

マネージド サービス ID トークンの資格情報に関する情報を提供します。 このオブジェクトは、マネージド サービス ID を使用して Azure にプロビジョニングされた仮想マシン上のトークンを取得するためにのみ使用できます。

コンストラクター

MSITokenCredentials(MSIOptions)

MSITokenCredentials のインスタンスを作成します。

プロパティ

resource

Azure リソース エンドポイント。

  • 既定では、環境から Azure Resource Manager:AzureCloud が使用されます。 「https://management.azure.com/"
  • ServiceManagement (ASM) の場合: "https://management.core.windows.net/"
  • Azure KeyVault の場合: "https://vault.azure.net"
  • Azure Batch の場合: "https://batch.core.windows.net"
  • Azure Active Directory Graph の場合: "https://graph.windows.net"

メソッド

getToken()

アクセス トークンで応答する、Azure VM でホストされているサービス エンドポイントに POST 要求を準備して送信します。

parseTokenResponse(string)

tokenResponse json 文字列をオブジェクトに解析し、最初のレベルのプロパティを camelCase に変換します。 このメソッドは tokenResponse の標準化を試みます

signRequest(WebResource)

Authentication ヘッダーを使用して要求に署名します。

コンストラクターの詳細

MSITokenCredentials(MSIOptions)

MSITokenCredentials のインスタンスを作成します。

new MSITokenCredentials(options: MSIOptions)

パラメーター

options
MSIOptions

省略可能なパラメーター

プロパティの詳細

resource

Azure リソース エンドポイント。

  • 既定では、環境から Azure Resource Manager:AzureCloud が使用されます。 「https://management.azure.com/"
  • ServiceManagement (ASM) の場合: "https://management.core.windows.net/"
  • Azure KeyVault の場合: "https://vault.azure.net"
  • Azure Batch の場合: "https://batch.core.windows.net"
  • Azure Active Directory Graph の場合: "https://graph.windows.net"
resource: string

プロパティ値

string

メソッドの詳細

getToken()

アクセス トークンで応答する、Azure VM でホストされているサービス エンドポイントに POST 要求を準備して送信します。

function getToken(): Promise<MSITokenResponse>

戻り値

Promise<MSITokenResponse>

トークン応答を使用した Promise。

parseTokenResponse(string)

tokenResponse json 文字列をオブジェクトに解析し、最初のレベルのプロパティを camelCase に変換します。 このメソッドは tokenResponse の標準化を試みます

function parseTokenResponse(body: string): TokenResponse

パラメーター

body

string

json 文字列

戻り値

TokenResponse

tokenResponse (tokenType と accessToken は 2 つの重要なプロパティです)。

signRequest(WebResource)

Authentication ヘッダーを使用して要求に署名します。

function signRequest(webResource: WebResource): Promise<WebResource>

パラメーター

webResource
WebResource

署名する WebResource。

戻り値

Promise<WebResource>

署名された WebResource を使用した Promise。