Get identityProvider

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 headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

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

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

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

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

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 OpenID Connect identity provider (external tenant)

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/identity/identityProviders/12345678-abcd-1234-cdef-aaaaaaaaaaaa
---

#### Response

The following example shows the response.
>**Note:** The response object shown here might be shortened for readability.

<!-- {
  "blockType": "response",
  "truncated": true,
  "@odata.type": "microsoft.graph.oidcIdentityProvider"
} -->

```http
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"
    }
  }
}