If successful, this method returns 201 Created response code and identityProvider object in the response body. If unsuccessful, a 4xx error will be returned with specific details.
Example
The following example creates an identityProvider.
POST https://graph.microsoft.com/v1.0/identityProviders
Content-type: application/json
{
"name": "Login with Amazon",
"type": "Amazon",
"clientId": "56433757-cadd-4135-8431-2c9e3fd68ae8",
"clientSecret": "000000000000"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new IdentityProvider
{
Name = "Login with Amazon",
Type = "Amazon",
ClientId = "56433757-cadd-4135-8431-2c9e3fd68ae8",
ClientSecret = "000000000000",
};
var result = await graphClient.IdentityProviders.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc identity-providers create --body '{\
"name": "Login with Amazon",\
"type": "Amazon",\
"clientId": "56433757-cadd-4135-8431-2c9e3fd68ae8",\
"clientSecret": "000000000000"\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new IdentityProvider();
$requestBody->setName('Login with Amazon');
$requestBody->setType('Amazon');
$requestBody->setClientId('56433757-cadd-4135-8431-2c9e3fd68ae8');
$requestBody->setClientSecret('000000000000');
$result = $graphServiceClient->identityProviders()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = IdentityProvider(
name = "Login with Amazon",
type = "Amazon",
client_id = "56433757-cadd-4135-8431-2c9e3fd68ae8",
client_secret = "000000000000",
)
result = await graph_client.identity_providers.post(body = request_body)