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.
Get the properties and relationships of the specified identity provider configured in the tenant.
Among the types of providers derived from identityProviderBase, in Microsoft Entra, this operation can get a socialIdentityProvider, appleManagedIdentityProvider (external tenant only), builtinIdentityProvider, or an oidcIdentityProvider (external tenant only) resource.
In Azure AD B2C, this operation can get 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.Read.All |
IdentityProvider.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
IdentityProvider.Read.All |
IdentityProvider.ReadWrite.All |
The work or school account needs to belong to at least the External Identity Provider Administrator or External Identity User Flow administrator Microsoft Entra role.
HTTP request
GET /identity/identityProviders/{id}
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a JSON representation of a socialIdentityProvider, appleManagedIdentityProvider, builtinIdentityProvider, or oidcIdentityProvider in the response body for a workforce or external tenant.
For an Azure AD B2C tenant, this method returns a 200 OK
response code and a JSON representation of a socialIdentityProvider, openIdConnectIdentityProvider, appleManagedIdentityProvider, or a builtinIdentityProvider object in the response body.
Examples
Example 1: Retrieve a social identity provider
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/identity/identityProviders/Amazon-OAUTH
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].GetAsync();
mgc-beta identity identity-providers get --identity-provider-base-id {identityProviderBase-id}
// 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"
//other-imports
)
// 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").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let identityProviderBase = await client.api('/identity/identityProviders/Amazon-OAUTH')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
Get-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').get()
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "Amazon-OAUTH",
"displayName": "Amazon",
"identityProviderType": "Amazon",
"clientId": "qazx.1234",
"clientSecret": "******"
}
Example 2: Retrieve a built-in identity provider
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/identity/identityProviders/MSASignup-OAUTH
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].GetAsync();
mgc-beta identity identity-providers get --identity-provider-base-id {identityProviderBase-id}
// 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"
//other-imports
)
// 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").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let identityProviderBase = await client.api('/identity/identityProviders/MSASignup-OAUTH')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
Get-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').get()
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "MSASignup-OAUTH",
"identityProviderType": "MicrosoftAccount",
"displayName": "MicrosoftAccount"
}
Example 3: Retrieve an Apple identity provider
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/identity/identityProviders/Apple-Managed-OIDC
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].GetAsync();
mgc-beta identity identity-providers get --identity-provider-base-id {identityProviderBase-id}
// 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"
//other-imports
)
// 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").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let identityProviderBase = await client.api('/identity/identityProviders/Apple-Managed-OIDC')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
Get-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').get()
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "Apple-Managed-OIDC",
"displayName": "Sign in with Apple",
"developerId": "developerId12345",
"serviceId": "com.microsoft.rts.b2c.test.client",
"keyId": "12345",
"certificateData": "******"
}
Example 4: Retrieve an OpenID Connect identity provider (Azure AD B2C tenant)
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/identity/identityProviders/Contoso-00001111-aaaa-2222-bbbb-3333cccc4444
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].GetAsync();
mgc-beta identity identity-providers get --identity-provider-base-id {identityProviderBase-id}
// 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"
//other-imports
)
// 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").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let identityProviderBase = await client.api('/identity/identityProviders/Contoso-00001111-aaaa-2222-bbbb-3333cccc4444')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
Get-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').get()
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.type": "microsoft.graph.openIdConnectIdentityProvider",
"id": "Contoso-00001111-aaaa-2222-bbbb-3333cccc4444",
"displayName": "Contoso",
"clientId": "00001111-aaaa-2222-bbbb-3333cccc4444",
"clientSecret": "4294967296",
"claimsMapping": {
"userId": "myUserId",
"givenName": "myGivenName",
"surname": "mySurname",
"email": "myEmail",
"displayName": "myDisplayName"
},
"domainHint": "mycustomoidc",
"metadataUrl": "https://mycustomoidc.com/.well-known/openid-configuration",
"responseMode": "form_post",
"responseType": "code",
"scope": "openid"
}
Example 5: Retrieve an OIDC identity provider (External tenant)
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/identity/identityProviders/12345678-abcd-1234-cdef-aaaaaaaaaaaa
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].GetAsync();
mgc-beta identity identity-providers get --identity-provider-base-id {identityProviderBase-id}
// 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"
//other-imports
)
// 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").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IdentityProviderBase result = graphClient.identity().identityProviders().byIdentityProviderBaseId("{identityProviderBase-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let identityProviderBase = await client.api('/identity/identityProviders/12345678-abcd-1234-cdef-aaaaaaaaaaaa')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identity()->identityProviders()->byIdentityProviderBaseId('identityProviderBase-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
Get-MgBetaIdentityProvider -IdentityProviderBaseId $identityProviderBaseId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity.identity_providers.by_identity_provider_base_id('identityProviderBase-id').get()
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.type": "#microsoft.graph.OidcIdentityProvider",
"id": "12345678-abcd-1234-cdef-aaaaaaaaaaaa",
"displayName": "Contoso",
"clientId": "00001111-aaaa-2222-bbbb-3333cccc4444",
"issuer": "https://contoso.b2clogin.com/00001111-aaaa-2222-bbbb-3333cccc4444/v2.0/",
"wellKnownEndpoint": "https://contoso.b2clogin.com/contoso.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1A_SIGNINEMAIL",
"responseType": "code",
"scope": "openid profile email offline_access",
"clientAuthentication": {
"@odata.type": "#microsoft.graph.OIDCClientSecretAuthentication",
"clientSecret": "12345"
},
"inboundClaimMapping": {
"sub": "sub",
"name": "name",
"given_name": "given_name",
"family_name": "family_name",
"email": "email",
"email_verified": "email_verified",
"phone_number": "phone_number",
"phone_number_verified": "phone_number_verified",
"address": {
"street_address": "street_address",
"locality": "locality",
"region": "region",
"postal_code": "postal_code",
"country": "country"
}
}
}