Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
IdentityProvider.ReadWrite.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
IdentityProvider.ReadWrite.All
Not available.
The work or school account must be a global administrator of the tenant.
HTTP request
PATCH /identityProviders/{id}
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, provide a JSON object with one or more properties that need to be updated.
Property
Type
Description
clientId
String
The client ID for the application. This is the client ID obtained when registering the application with the identity provider.
clientSecret
String
The client secret for the application. This is the client secret obtained when registering the application with the identity provider.
name
String
The display name of the identity provider.
Response
If successful, this method returns 204 No Content response code. If unsuccessful, a 4xx error will be returned with specific details.
Example
The following example updates the definition of the token lifetime identityProvider and sets it as the organization default.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IdentityProvider
{
ClientSecret = "1111111111111",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityProviders["{identityProvider-id}"].PatchAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc identity-providers patch --identity-provider-id {identityProvider-id} --body '{\
"clientSecret": "1111111111111"\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new IdentityProvider();
$requestBody->setClientSecret('1111111111111');
$result = $graphServiceClient->identityProviders()->byIdentityProviderId('identityProvider-id')->patch($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = IdentityProvider(
client_secret = "1111111111111",
)
result = await graph_client.identity_providers.by_identity_provider_id('identityProvider-id').patch(request_body)