identityProvider を作成する

名前空間: microsoft.graph

要求本文で指定された種類の ID プロバイダー リソースを作成します。

identityProviderBase から派生したプロバイダーの種類の中で、現在、ソーシャルIdentityProviderリソースを Azure AD。 B2C Azure AD、この操作は現在、socialIdentityProviderまたはappleManagedIdentityProviderリソースを作成できます。

アクセス許可

この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。

アクセス許可の種類 アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント) IdentityProvider.ReadWrite.All
委任 (個人用 Microsoft アカウント) サポートされていません。
アプリケーション IdentityProvider.ReadWrite.All

仕事または学校のアカウントは、次のいずれかの役割に属している必要があります。

  • グローバル管理者
  • 外部 ID プロバイダー管理者

HTTP 要求

POST /identity/identityProviders

要求ヘッダー

名前 説明
Authorization ベアラー {token}。必須。
Content-Type application/json. Required.

要求本文

要求本文で、ソーシャルIdentityProviderオブジェクトの JSON 表記を指定Azure AD。

このAzure AD B2C は、socialIdentityProviderまたは appleManagedIdentityProviderオブジェクトの JSON 表現を提供します。

socialIdentityProvider オブジェクト

プロパティ 説明
clientId 文字列 アプリケーションを ID プロバイダーに登録した際に取得したクライアント識別子です。
clientSecret String アプリケーションが ID プロバイダーに登録された際に取得したクライアント シークレットです。 これは、書き込み専用です。 読み取り操作を行うと、**** が返されます。
displayName String ID プロバイダーの表示名。
identityProviderType String B2B シナリオでは、次の値が使用されます。GoogleFacebook。 B2B シナリオでは、次の値が使用されます。MicrosoftGoogleAmazonLinkedInFacebookGitHubTwitterWeiboQQWeChat
scope String スコープは、カスタム ID プロバイダーから収集する情報とアクセス許可を定義します。

appleIdentityProvider オブジェクト

プロパティ 説明
displayName String ID プロバイダーの表示名。
developerId String Apple の開発者 ID。
serviceId String Apple のサービス ID。
keyId String Apple のキー識別子。
certificateData String 証明書からのテキストの長い文字列である証明書データは、null 値である可能性があります。

応答

成功した場合、このメソッドは、応答コードと、テナントの応答本文で 201 Created socialIdentityProviderオブジェクトの JSON 表現をAzure ADします。

B2C Azure ADの場合、このメソッドは応答コードと、応答本文の 201 Created socialIdentityProvider、または appleManagedIdentityProviderオブジェクトの JSON 表現を返します。

失敗した場合、4xx エラーが詳細情報とともに返されます。

例 1: 特定のソーシャル ID プロバイダーを作成する (Azure AD B2C Azure AD)

要求

要求の例を次に示します。

POST https://graph.microsoft.com/v1.0/identity/identityProviders
Content-type: application/json

{
  "@odata.type": "microsoft.graph.socialIdentityProvider",
  "displayName": "Login with Amazon",
  "identityProviderType": "Amazon",
  "clientId": "56433757-cadd-4135-8431-2c9e3fd68ae8",
  "clientSecret": "000000000000"
}

応答

応答の例を次に示します。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.type": "microsoft.graph.socialIdentityProvider",
    "id": "Amazon-OAUTH",
    "displayName": "Login with Amazon",
    "identityProviderType": "Amazon",
    "clientId": "56433757-cadd-4135-8431-2c9e3fd68ae8",
    "clientSecret": "000000000000"
}

例 2: Apple ID プロバイダーを取得します (B2C Azure ADのみ)

要求

要求の例を次に示します。

POST https://graph.microsoft.com/v1.0/identity/identityProviders
Content-type: application/json

{
  "@odata.type": "microsoft.graph.appleManagedIdentityProvider",
  "displayName": "Sign in with Apple",
  "developerId": "UBF8T346G9",
  "serviceId": "com.microsoft.rts.b2c.test.client",
  "keyId": "99P6D879C4",
  "certificateData": "******"
}

応答

応答の例を次に示します。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

HTTP/1.1 201 Created
Content-type: application/json

{
  "@odata.type": "microsoft.graph.appleManagedIdentityProvider",
  "id": "Apple-Managed-OIDC",
  "displayName": "Sign in with Apple",
  "developerId": "UBF8T346G9",
  "serviceId": "com.microsoft.rts.b2c.test.client",
  "keyId": "99P6D879C4",
  "certificateData": "******"
}