Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
IdentityProvider.ReadWrite.All
No disponible.
Delegado (cuenta personal de Microsoft)
No admitida.
No admitida.
Aplicación
IdentityProvider.ReadWrite.All
No disponible.
Importante
En escenarios delegados con cuentas profesionales o educativas, al usuario que ha iniciado sesión se le debe asignar un rol de Microsoft Entra compatible o un rol personalizado con un permiso de rol admitido.
El administrador del proveedor de identidades externo es el rol con privilegios mínimos admitido para esta operación.
El identificador de cliente para la aplicación que se obtiene al registrar la aplicación con el proveedor de identidades.
clientSecret
Cadena
El secreto de cliente para la aplicación que se obtiene al registrar la aplicación con el proveedor de identidades. Es de solo escritura. Una operación de lectura devuelve ****.
displayName
Cadena
El nombre para mostrar del proveedor de identidades.
identityProviderType
Cadena
Para un escenario B2B, valores posibles: Google, Facebook. Para un escenario B2C, valores posibles: Microsoft, Google, Amazon, LinkedIn, Facebook, GitHub, Twitter, Weibo, QQ, WeChat.
ámbito
Cadena
El ámbito define la información y los permisos que desea recopilar del proveedor de identidades personalizado.
appleIdentityProvider (objeto)
Propiedad
Tipo
Descripción
displayName
Cadena
El nombre para mostrar del proveedor de identidades.
developerId
Cadena
El identificador de desarrollador de Apple.
serviceId
Cadena
El identificador de servicio de Apple.
keyId
Cadena
El identificador de clave de Apple.
certificateData
Cadena
Los datos de certificado, que son una cadena larga de texto del certificado, puede ser nulo.
Respuesta
Si se ejecuta correctamente, este método devuelve un 201 Created código de respuesta y una representación JSON de un objeto socialIdentityProvider en el cuerpo de la respuesta de un inquilino de Microsoft Entra.
Para un inquilino de Azure AD B2C, este método devuelve un 201 Created código de respuesta y una representación JSON de un socialIdentityProvider o un objeto appleManagedIdentityProvider en el cuerpo de la respuesta.
Si falla, se devolverá un error 4xx con detalles específicos.
Ejemplos
Ejemplo 1: Creación de un proveedor de identidades sociales específico (Microsoft Entra ID y Azure AD B2C)
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"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new SocialIdentityProvider
{
OdataType = "microsoft.graph.socialIdentityProvider",
DisplayName = "Login with Amazon",
IdentityProviderType = "Amazon",
ClientId = "56433757-cadd-4135-8431-2c9e3fd68ae8",
ClientSecret = "000000000000",
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.IdentityProviders.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewIdentityProviderBase()
displayName := "Login with Amazon"
requestBody.SetDisplayName(&displayName)
identityProviderType := "Amazon"
requestBody.SetIdentityProviderType(&identityProviderType)
clientId := "56433757-cadd-4135-8431-2c9e3fd68ae8"
requestBody.SetClientId(&clientId)
clientSecret := "000000000000"
requestBody.SetClientSecret(&clientSecret)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
identityProviders, err := graphClient.Identity().IdentityProviders().Post(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("Login with Amazon");
identityProviderBase.setIdentityProviderType("Amazon");
identityProviderBase.setClientId("56433757-cadd-4135-8431-2c9e3fd68ae8");
identityProviderBase.setClientSecret("000000000000");
IdentityProviderBase result = graphClient.identity().identityProviders().post(identityProviderBase);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\SocialIdentityProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SocialIdentityProvider();
$requestBody->setOdataType('microsoft.graph.socialIdentityProvider');
$requestBody->setDisplayName('Login with Amazon');
$requestBody->setIdentityProviderType('Amazon');
$requestBody->setClientId('56433757-cadd-4135-8431-2c9e3fd68ae8');
$requestBody->setClientSecret('000000000000');
$result = $graphServiceClient->identity()->identityProviders()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.social_identity_provider import SocialIdentityProvider
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SocialIdentityProvider(
odata_type = "microsoft.graph.socialIdentityProvider",
display_name = "Login with Amazon",
identity_provider_type = "Amazon",
client_id = "56433757-cadd-4135-8431-2c9e3fd68ae8",
client_secret = "000000000000",
)
result = await graph_client.identity.identity_providers.post(request_body)
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": "******"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AppleManagedIdentityProvider
{
OdataType = "microsoft.graph.appleManagedIdentityProvider",
DisplayName = "Sign in with Apple",
DeveloperId = "UBF8T346G9",
ServiceId = "com.microsoft.rts.b2c.test.client",
KeyId = "99P6D879C4",
CertificateData = "******",
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.IdentityProviders.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewIdentityProviderBase()
displayName := "Sign in with Apple"
requestBody.SetDisplayName(&displayName)
developerId := "UBF8T346G9"
requestBody.SetDeveloperId(&developerId)
serviceId := "com.microsoft.rts.b2c.test.client"
requestBody.SetServiceId(&serviceId)
keyId := "99P6D879C4"
requestBody.SetKeyId(&keyId)
certificateData := "******"
requestBody.SetCertificateData(&certificateData)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
identityProviders, err := graphClient.Identity().IdentityProviders().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AppleManagedIdentityProvider identityProviderBase = new AppleManagedIdentityProvider();
identityProviderBase.setOdataType("microsoft.graph.appleManagedIdentityProvider");
identityProviderBase.setDisplayName("Sign in with Apple");
identityProviderBase.setDeveloperId("UBF8T346G9");
identityProviderBase.setServiceId("com.microsoft.rts.b2c.test.client");
identityProviderBase.setKeyId("99P6D879C4");
identityProviderBase.setCertificateData("******");
IdentityProviderBase result = graphClient.identity().identityProviders().post(identityProviderBase);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AppleManagedIdentityProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AppleManagedIdentityProvider();
$requestBody->setOdataType('microsoft.graph.appleManagedIdentityProvider');
$requestBody->setDisplayName('Sign in with Apple');
$requestBody->setDeveloperId('UBF8T346G9');
$requestBody->setServiceId('com.microsoft.rts.b2c.test.client');
$requestBody->setKeyId('99P6D879C4');
$requestBody->setCertificateData('******');
$result = $graphServiceClient->identity()->identityProviders()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.apple_managed_identity_provider import AppleManagedIdentityProvider
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AppleManagedIdentityProvider(
odata_type = "microsoft.graph.appleManagedIdentityProvider",
display_name = "Sign in with Apple",
developer_id = "UBF8T346G9",
service_id = "com.microsoft.rts.b2c.test.client",
key_id = "99P6D879C4",
certificate_data = "******",
)
result = await graph_client.identity.identity_providers.post(request_body)