ManagedIdentityCredential class

デプロイ環境で使用可能なマネージド ID を使用して認証を試みます。 この認証タイプはAzure VM、App Serviceインスタンス、Azure Functionsアプリケーション、Azure Kubernetes Services、Azure Service Fabricインスタンス、そしてAzure Cloud Shell内部で動作します。

マネージド ID の構成の詳細については、次を参照してください:https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview

コンストラクター

ManagedIdentityCredential(ManagedIdentityCredentialClientIdOptions)

クライアント ID を使用して ManagedIdentityCredential のインスタンスを作成します

ManagedIdentityCredential(ManagedIdentityCredentialObjectIdOptions)

オブジェクト ID を使用して ManagedIdentityCredential のインスタンスを作成します

ManagedIdentityCredential(ManagedIdentityCredentialResourceIdOptions)

リソース ID を使用して ManagedIdentityCredential のインスタンスを作成します

ManagedIdentityCredential(string, TokenCredentialOptions)

ユーザー割り当て ID のクライアント ID またはアプリの登録 (AKS ポッド ID を操作する場合) を使用して、ManagedIdentityCredential のインスタンスを作成します。

メソッド

getToken(string | string[], GetTokenOptions)

Microsoft Entra IDで認証し、成功するとアクセストークンを返します。 認証に失敗すると、CredentialUnavailableError がスローされ、エラーの詳細が表示されます。 予期しないエラーが発生すると、AuthenticationError がスローされ、エラーの詳細が表示されます。

コンストラクターの詳細

ManagedIdentityCredential(ManagedIdentityCredentialClientIdOptions)

クライアント ID を使用して ManagedIdentityCredential のインスタンスを作成します

new ManagedIdentityCredential(options?: ManagedIdentityCredentialClientIdOptions)

パラメーター

options
ManagedIdentityCredentialClientIdOptions

アクセス トークン要求を行うクライアントを構成するためのオプション。

ManagedIdentityCredential(ManagedIdentityCredentialObjectIdOptions)

オブジェクト ID を使用して ManagedIdentityCredential のインスタンスを作成します

new ManagedIdentityCredential(options?: ManagedIdentityCredentialObjectIdOptions)

パラメーター

options
ManagedIdentityCredentialObjectIdOptions

アクセス トークン要求を行うリソースを構成するためのオプション。

ManagedIdentityCredential(ManagedIdentityCredentialResourceIdOptions)

リソース ID を使用して ManagedIdentityCredential のインスタンスを作成します

new ManagedIdentityCredential(options?: ManagedIdentityCredentialResourceIdOptions)

パラメーター

options
ManagedIdentityCredentialResourceIdOptions

アクセス トークン要求を行うリソースを構成するためのオプション。

ManagedIdentityCredential(string, TokenCredentialOptions)

ユーザー割り当て ID のクライアント ID またはアプリの登録 (AKS ポッド ID を操作する場合) を使用して、ManagedIdentityCredential のインスタンスを作成します。

new ManagedIdentityCredential(clientId: string, options?: TokenCredentialOptions)

パラメーター

clientId

string

ユーザー割り当て ID のクライアント ID、またはアプリの登録 (AKS ポッド ID を操作する場合)。

options
TokenCredentialOptions

アクセス トークン要求を行うクライアントを構成するためのオプション。

メソッドの詳細

getToken(string | string[], GetTokenOptions)

Microsoft Entra IDで認証し、成功するとアクセストークンを返します。 認証に失敗すると、CredentialUnavailableError がスローされ、エラーの詳細が表示されます。 予期しないエラーが発生すると、AuthenticationError がスローされ、エラーの詳細が表示されます。

function getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>

パラメーター

scopes

string | string[]

トークンがアクセスできるスコープの一覧。

options
GetTokenOptions

この TokenCredential 実装が行う可能性がある要求を構成するために使用されるオプション。

返品

Promise<AccessToken>