identityProvider を更新する
[アーティクル]
12/06/2021
3 人の共同作成者
この記事の内容
名前空間: microsoft.graph
テナントで構成されている指定した ID プロバイダーのプロパティを更新します。
identityProviderBase から派生したプロバイダーの種類の中で、現在、idProvider リソースを更新Azure AD。 B2C Azure AD、この操作は現在、socialIdentityProvider またはappleManagedIdentityProvider リソースを更新 できます。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
IdentityProvider.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
IdentityProvider.ReadWrite.All
仕事または学校のアカウントは、次のいずれかの役割に属している必要があります。
HTTP 要求
PATCH /identity/identityProviders/{id}
名前
説明
Authorization
ベアラー {token}。必須。
Content-Type
application/json. Required.
要求本文
要求本文で、テナント内のsocialIdentityProvider オブジェクトに対して更新する必要がある 1 つ以上のプロパティを JSON オブジェクトAzure ADします。
B2C Azure AD、socialIdentityProvider またはappleManagedIdentityProvider オブジェクトに対して更新する必要がある 1 つ以上のプロパティを JSON オブジェクトに提供します。
socialIdentityProvider オブジェクト
プロパティ
種類
説明
clientId
String
ID プロバイダーにアプリケーションを登録するときに取得したクライアント アプリケーションの識別子。
clientSecret
String
アプリケーションが ID プロバイダーに登録された際に取得したクライアント シークレットです。 これは、書き込み専用です。 読み取り操作を行うと、**** が返されます。
displayName
String
ID プロバイダーの表示名。
appleManagedIdentityProvider オブジェクト
プロパティ
種類
説明
displayName
String
ID プロバイダーの表示名。
developerId
String
Apple の開発者 ID。
serviceId
String
Apple のサービス ID。
keyId
String
Apple のキー識別子。
certificateData
String
証明書からのテキストの長い文字列である証明書データは、null 値である可能性があります。
応答
成功した場合、このメソッドは 204 No Content 応答コードを返します。 失敗した場合、4xx エラーが詳細情報とともに返されます。
例
例 1: 特定のソーシャル ID プロバイダーを更新する (Azure ADまたは B2C Azure AD)
要求
要求の例を次に示します。
PATCH https://graph.microsoft.com/v1.0/identity/identityProviders/Amazon-OAUTH
Content-type: application/json
{
"@odata.type": "#microsoft.graph.socialIdentityProvider",
"clientSecret": "1111111111111"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var identityProviderBase = new SocialIdentityProvider
{
ClientSecret = "1111111111111"
};
await graphClient.Identity.IdentityProviders["{identityProviderBase-id}"]
.Request()
.UpdateAsync(identityProviderBase);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
const identityProviderBase = {
'@odata.type': '#microsoft.graph.socialIdentityProvider',
clientSecret: '1111111111111'
};
await client.api('/identity/identityProviders/Amazon-OAUTH')
.update(identityProviderBase);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/identity/identityProviders/Amazon-OAUTH"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphIdentityProviderBase *identityProviderBase = [[MSGraphIdentityProviderBase alloc] init];
[identityProviderBase setClientSecret:@"1111111111111"];
NSError *error;
NSData *identityProviderBaseData = [identityProviderBase getSerializedDataWithError:&error];
[urlRequest setHTTPBody:identityProviderBaseData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SocialIdentityProvider identityProviderBase = new SocialIdentityProvider();
identityProviderBase.clientSecret = "1111111111111";
graphClient.identity().identityProviders("Amazon-OAUTH")
.buildRequest()
.patch(identityProviderBase);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewIdentityProviderBase()
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.socialIdentityProvider",
"clientSecret": "1111111111111",
}
identityProviderBaseId := "identityProviderBase-id"
graphClient.Identity().IdentityProvidersById(&identityProviderBaseId).Patch(requestBody)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
HTTP/1.1 204 No Content
例 2: 特定の Apple ID プロバイダーを更新 する (B2C Azure ADのみ)
要求
要求の例を次に示します。
PATCH https://graph.microsoft.com/v1.0/identity/identityProviders/Apple-Managed-OIDC
Content-type: application/json
{
"@odata.type": "#microsoft.graph.socialIdentityProvider",
"displayName": "Apple"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var identityProviderBase = new SocialIdentityProvider
{
DisplayName = "Apple"
};
await graphClient.Identity.IdentityProviders["{identityProviderBase-id}"]
.Request()
.UpdateAsync(identityProviderBase);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
const identityProviderBase = {
'@odata.type': '#microsoft.graph.socialIdentityProvider',
displayName: 'Apple'
};
await client.api('/identity/identityProviders/Apple-Managed-OIDC')
.update(identityProviderBase);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/identity/identityProviders/Apple-Managed-OIDC"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphIdentityProviderBase *identityProviderBase = [[MSGraphIdentityProviderBase alloc] init];
[identityProviderBase setDisplayName:@"Apple"];
NSError *error;
NSData *identityProviderBaseData = [identityProviderBase getSerializedDataWithError:&error];
[urlRequest setHTTPBody:identityProviderBaseData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SocialIdentityProvider identityProviderBase = new SocialIdentityProvider();
identityProviderBase.displayName = "Apple";
graphClient.identity().identityProviders("Apple-Managed-OIDC")
.buildRequest()
.patch(identityProviderBase);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewIdentityProviderBase()
displayName := "Apple"
requestBody.SetDisplayName(&displayName)
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.socialIdentityProvider",
}
identityProviderBaseId := "identityProviderBase-id"
graphClient.Identity().IdentityProvidersById(&identityProviderBaseId).Patch(requestBody)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
応答の例を次に示します。
HTTP/1.1 204 No Content