Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Update the properties of the specified external identity provider configured in the tenant.
Among the types of providers derived from identityProviderBase, in Microsoft Entra, this operation can update a socialIdentityProvider, appleManagedIdentityProvider (external tenant only), or an oidcIdentityProvider (external tenant only) resource.
In Azure AD B2C, this operation can update a socialIdentityProvider, appleManagedIdentityProvider, builtinIdentityProvider, or an openIdConnectIdentityProvider resource.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
✅ |
Permissions
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. |
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. External Identity Provider Administrator is the least privileged role supported for this operation.
HTTP request
PATCH /identity/identityProviders/{id}
Request body
In Microsoft Entra External ID, provide a JSON object the request body with one or more properties that need to be updated for a socialIdentityProvider appleManagedIdentityProvider, or oidcIdentityProvider object.
In Azure AD B2C, provide a JSON object the request body with one or more properties that need to be updated for a socialIdentityProvider, appleManagedIdentityProvider, or an openIdConnectIdentityProvider object.
socialIdentityProvider object
Property |
Type |
Description |
clientId |
String |
The client identifier for the application obtained when registering the application with the identity provider. |
clientSecret |
String |
The client secret for the application that is obtained when the application is registered with the identity provider. This is write-only. A read operation returns **** . |
displayName |
String |
The display name of the identity provider. |
identityProviderType |
String |
For external and workforce tenants, possible values: Facebook , Google . For Azure AD B2C tenants, possible values: Microsoft , Google , Amazon , LinkedIn , Facebook , GitHub , Twitter , Weibo , QQ , WeChat . |
appleManagedIdentityProvider object
Property |
Type |
Description |
certificateData |
String |
The certificate data which is a long string of text from the certificate, can be null. |
developerId |
String |
The Apple developer identifier. |
displayName |
String |
The display name of the identity provider. |
keyId |
String |
The Apple key identifier. |
serviceId |
String |
The Apple service identifier. |
openIdConnectIdentityProvider object
Property |
Type |
Description |
claimsMapping |
claimsMapping |
After the OIDC provider sends an ID token back to Microsoft Entra ID, Microsoft Entra ID needs to be able to map the claims from the received token to the claims that Microsoft Entra ID recognizes and uses. This complex type captures that mapping. |
clientId |
String |
The client identifier for the application obtained when registering the application with the identity provider. |
clientSecret |
String |
The client secret for the application obtained when registering the application with the identity provider. The clientSecret has a dependency on responseType. - When responseType is
code , a secret is required for the auth code exchange. - When responseType is
id_token the secret is not required because there is no code exchange in the authentication pipeline. In this mode, the id_token is returned directly from the authorization response.
|
displayName |
String |
The display name of the identity provider. |
domainHint |
String |
The ___domain hint can be used to skip directly to the sign in page of the specified identity provider, instead of having the user make a selection among the list of available identity providers. |
metadataUrl |
String |
The URL for the metadata document of the OpenID Connect identity provider. Every OpenID Connect identity provider describes a metadata document that contains most of the information required to perform sign-in. This includes information such as the URLs to use and the ___location of the service's public signing keys. The OpenID Connect metadata document is always located at an endpoint that ends in .well-known/openid-configuration . Provide the metadata URL for the OpenID Connect identity provider you add. |
responseMode |
String |
The response mode defines the method used to send data back from the custom identity provider to Azure AD B2C. Possible values: form_post , query . |
responseType |
String |
The response type describes the type of information sent back in the initial call to the authorization_endpoint of the custom identity provider. Possible values: code , id_token , token . |
scope |
String |
Scope defines the information and permissions you are looking to gather from your custom identity provider. |
oidcIdentityProvider object
Property |
Type |
Description |
clientAuthentication |
clientAuthentication |
The client authentication settings. use oidcClientSecretAuthentication type for setting up your identity provider with client_secret_post or client_secret_jwt authentication methods. use oidcPrivateJwtKeyClientAuthentication type for setting up your identity provider with private_key_jwt authentication method. Due to security reasons, client_secret_basic authentication method is not supported. |
clientId |
String |
The client ID for the application obtained when registering the application with the identity provider. |
displayName |
String |
The display name of the identity provider. |
inboundclaimMapping |
inboundclaimMapping |
After the OIDC provider sends an ID token back to Microsoft Entra External ID, Microsoft Entra External ID needs to be able to map the claims from the received token to the claims that Microsoft Entra ID recognizes and uses. This complex type captures that mapping. |
issuer |
String |
The issuer URI. Issuer URI is a case-sensitive URL using https scheme contains scheme, host, and optionally, port number and path components and no query or fragment components. Note: Configuring other Microsoft Entra tenants as an external identity provider is currently not supported. As a result, the microsoftonline.com ___domain in the issuer URI is not accepted. |
responseType |
String |
The response type describes the type of information sent back in the initial call to the authorization_endpoint of the custom identity provider. Possible values: code , id_token , token . |
scope |
String |
Scope defines the information and permissions you are looking to gather from your custom identity provider. |
wellKnownEndpoint |
String |
The URL for the metadata document of the OpenID Connect identity provider. Every OpenID Connect identity provider describes a metadata document that contains most of the information required to perform sign-in. This includes information such as the URLs to use and the ___location of the service's public signing keys. The OpenID Connect metadata document is always located at an endpoint that ends in .well-known/openid-configuration . Note: The metadata document should, at minimum, contain the following properties: issuer , authorization_endpoint , token_endpoint , token_endpoint_auth_methods_supported , response_types_supported , subject_types_supported and jwks_uri . Visit OpenID Connect Discovery specifications for more details. |
Response
If successful, this method returns a 204 No Content
response code. If unsuccessful, a 4xx
error will be returned with specific details.
Examples
Example 1: Update a social identity provider
Request
The following example shows a request.
PATCH https://graph.microsoft.com/beta/identity/identityProviders/Amazon-OAUTH
Content-type: application/json
{
"@odata.type": "#microsoft.graph.socialIdentityProvider",
"clientSecret": "4294967296"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new SocialIdentityProvider
{
OdataType = "#microsoft.graph.socialIdentityProvider",
ClientSecret = "4294967296",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.IdentityProviders["{identityProviderBase-id}"].PatchAsync(requestBody);
mgc-beta identity identity-providers patch --identity-provider-base-id {identityProviderBase-id} --body '{\
"@odata.type": "#microsoft.graph.socialIdentityProvider",\
"clientSecret": "4294967296"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewIdentityProviderBase()
clientSecret := "4294967296"
requestBody.SetClientSecret(&clientSecret)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
identityProviders, err := graphClient.Identity().IdentityProviders().ByIdentityProviderBaseId("identityProviderBase-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
SocialIdentityProvider identityProviderBase = new SocialIdentityProvider();
identityProviderBase.setOdataType("#microsoft.graph.socialIdentityProvider");
identityProviderBase.setClientSecret("4294967296");
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").patch(identityProviderBase);
const options = {
authProvider,
};
const client = Client.init(options);
const identityProviderBase = {
'@odata.type': '#microsoft.graph.socialIdentityProvider',
clientSecret: '4294967296'
};
await client.api('/identity/identityProviders/Amazon-OAUTH')
.version('beta')
.update(identityProviderBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\SocialIdentityProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SocialIdentityProvider();
$requestBody->setOdataType('#microsoft.graph.socialIdentityProvider');
$requestBody->setClientSecret('4294967296');
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.socialIdentityProvider"
clientSecret = "4294967296"
}
Update-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.social_identity_provider import SocialIdentityProvider
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SocialIdentityProvider(
odata_type = "#microsoft.graph.socialIdentityProvider",
client_secret = "4294967296",
)
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').patch(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 2: Update an Apple identity provider
Request
The following example shows a request.
PATCH https://graph.microsoft.com/beta/identity/identityProviders/Apple-Managed-OIDC
Content-type: application/json
{
"@odata.type": "#microsoft.graph.socialIdentityProvider",
"displayName": "Apple"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new SocialIdentityProvider
{
OdataType = "#microsoft.graph.socialIdentityProvider",
DisplayName = "Apple",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.IdentityProviders["{identityProviderBase-id}"].PatchAsync(requestBody);
mgc-beta identity identity-providers patch --identity-provider-base-id {identityProviderBase-id} --body '{\
"@odata.type": "#microsoft.graph.socialIdentityProvider",\
"displayName": "Apple"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewIdentityProviderBase()
displayName := "Apple"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
identityProviders, err := graphClient.Identity().IdentityProviders().ByIdentityProviderBaseId("identityProviderBase-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
SocialIdentityProvider identityProviderBase = new SocialIdentityProvider();
identityProviderBase.setOdataType("#microsoft.graph.socialIdentityProvider");
identityProviderBase.setDisplayName("Apple");
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").patch(identityProviderBase);
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')
.version('beta')
.update(identityProviderBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\SocialIdentityProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SocialIdentityProvider();
$requestBody->setOdataType('#microsoft.graph.socialIdentityProvider');
$requestBody->setDisplayName('Apple');
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.socialIdentityProvider"
displayName = "Apple"
}
Update-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.social_identity_provider import SocialIdentityProvider
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SocialIdentityProvider(
odata_type = "#microsoft.graph.socialIdentityProvider",
display_name = "Apple",
)
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').patch(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 3: Update an OpenID Connect identity provider (Azure AD B2C tenant)
Request
The following example shows a request.
PATCH https://graph.microsoft.com/beta/identity/identityProviders/Contoso-OIDC-00001111-aaaa-2222-bbbb-3333cccc4444
Content-type: application/json
{
"@odata.type": "#microsoft.graph.openIdConnectIdentityProvider",
"responseType": "id_token"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new OpenIdConnectIdentityProvider
{
OdataType = "#microsoft.graph.openIdConnectIdentityProvider",
ResponseType = OpenIdConnectResponseTypes.Id_token,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.IdentityProviders["{identityProviderBase-id}"].PatchAsync(requestBody);
mgc-beta identity identity-providers patch --identity-provider-base-id {identityProviderBase-id} --body '{\
"@odata.type": "#microsoft.graph.openIdConnectIdentityProvider",\
"responseType": "id_token"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewIdentityProviderBase()
responseType := graphmodels.ID_TOKEN_OPENIDCONNECTRESPONSETYPES
requestBody.SetResponseType(&responseType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
identityProviders, err := graphClient.Identity().IdentityProviders().ByIdentityProviderBaseId("identityProviderBase-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OpenIdConnectIdentityProvider identityProviderBase = new OpenIdConnectIdentityProvider();
identityProviderBase.setOdataType("#microsoft.graph.openIdConnectIdentityProvider");
identityProviderBase.setResponseType(EnumSet.of(OpenIdConnectResponseTypes.Id_token));
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").patch(identityProviderBase);
const options = {
authProvider,
};
const client = Client.init(options);
const identityProviderBase = {
'@odata.type': '#microsoft.graph.openIdConnectIdentityProvider',
responseType: 'id_token'
};
await client.api('/identity/identityProviders/Contoso-OIDC-00001111-aaaa-2222-bbbb-3333cccc4444')
.version('beta')
.update(identityProviderBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\OpenIdConnectIdentityProvider;
use Microsoft\Graph\Beta\Generated\Models\OpenIdConnectResponseTypes;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OpenIdConnectIdentityProvider();
$requestBody->setOdataType('#microsoft.graph.openIdConnectIdentityProvider');
$requestBody->setResponseType(new OpenIdConnectResponseTypes('id_token'));
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.openIdConnectIdentityProvider"
responseType = "id_token"
}
Update-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.open_id_connect_identity_provider import OpenIdConnectIdentityProvider
from msgraph_beta.generated.models.open_id_connect_response_types import OpenIdConnectResponseTypes
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OpenIdConnectIdentityProvider(
odata_type = "#microsoft.graph.openIdConnectIdentityProvider",
response_type = OpenIdConnectResponseTypes.Id_token,
)
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').patch(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 4: Update an OpenID Connect identity provider (external tenant)
Request
The following example shows a request.
PATCH https://graph.microsoft.com/beta/identity/identityProviders/ContosoOIDCIdentityProvider
Content-type: application/json
{
"@odata.type": "#microsoft.graph.oidcIdentityProvider",
"displayName": "Contoso"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new OidcIdentityProvider
{
OdataType = "#microsoft.graph.oidcIdentityProvider",
DisplayName = "Contoso",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.IdentityProviders["{identityProviderBase-id}"].PatchAsync(requestBody);
mgc-beta identity identity-providers patch --identity-provider-base-id {identityProviderBase-id} --body '{\
"@odata.type": "#microsoft.graph.oidcIdentityProvider",\
"displayName": "Contoso"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewIdentityProviderBase()
displayName := "Contoso"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
identityProviders, err := graphClient.Identity().IdentityProviders().ByIdentityProviderBaseId("identityProviderBase-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OidcIdentityProvider identityProviderBase = new OidcIdentityProvider();
identityProviderBase.setOdataType("#microsoft.graph.oidcIdentityProvider");
identityProviderBase.setDisplayName("Contoso");
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").patch(identityProviderBase);
const options = {
authProvider,
};
const client = Client.init(options);
const identityProviderBase = {
'@odata.type': '#microsoft.graph.oidcIdentityProvider',
displayName: 'Contoso'
};
await client.api('/identity/identityProviders/ContosoOIDCIdentityProvider')
.version('beta')
.update(identityProviderBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\OidcIdentityProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OidcIdentityProvider();
$requestBody->setOdataType('#microsoft.graph.oidcIdentityProvider');
$requestBody->setDisplayName('Contoso');
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.oidcIdentityProvider"
displayName = "Contoso"
}
Update-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.oidc_identity_provider import OidcIdentityProvider
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OidcIdentityProvider(
odata_type = "#microsoft.graph.oidcIdentityProvider",
display_name = "Contoso",
)
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').patch(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content