Identity Provider API
On this page
An Identity Provider is a named object that provides configuration to describe an external identity provider. This configuration will be used to perform an alternative login to the standard FusionAuth local login. FusionAuth currently supports a number of different identity provider types:
- Apple
- Epic Games - requires a paid plan.
- External JWT
- HYPR
- Nintendo - requires a paid plan.
- OpenID Connect
- SAML v2
- SAML v2 IdP Initiated - requires a paid plan.
- Sony PlayStation Network - requires a paid plan.
- Steam - requires a paid plan.
- Twitch - requires a paid plan.
- Xbox - requires a paid plan.
You can test Identity Provider connections using the Test API.
The type of the identity provider will determine the object's properties as well as the validation that is performed. You can click into any of the identity provider API docs to get a list of that identity provider's properties.
To learn how to configure these Identity Providers using the FusionAuth UI, go here Identity Providers.
The way a link is established between an identity provider and FusionAuth is determined by the linkingStrategy for each identity provider. An API is provided to manually link and unlink a user to a 3rd party identity provider. To learn more about managing links between FusionAuth and a 3rd party identity provider, see the Link APIs.
Retrieve All Identity Providers#
Request#
Retrieve all of the configured Identity Providers.
OpenAPI Spec
Response#
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
Response Body#
The response JSON can include different types of Identity Providers. For the response JSON format of a type, see the Retrieve section in the documentation for that Identity Provider type. This API uses the same format.
identityProvidersThe list of Identity Provider objects.
{
"identityProviders": [
{
"claimMap": {
"first_name": "firstName",
"last_name": "lastName",
"dept": "RegistrationData"
},
"domains": [
"acme.com",
"acme.org"
],
"headerKeyParameter": "kid",
"id": "a4e78daa-33a6-4844-b081-7779af1f09a4",
"insertInstant": 1595361142909,
"lastUpdateInstant": 1595361143101,
"name": "Acme Corp. ADFS",
"oauth2": {
"authorization_endpoint": "https://acme.com/adfs/oauth2/authorize?client_id=cf3b00da-9551-460a-ad18-33232e6cbff0&response_type=code&redirect_uri=https://acme.com/oauth2/redirect",
"token_endpoint": "https://acme.com/adfs/oauth2/token"
},
"type": "ExternalJWT",
"uniqueIdentityClaim": "email"
},
{
"appId": "385572258114379",
"applicationConfiguration": {
"1c212e59-0d0e-6b1a-ad48-f4f92793be32": {
"createRegistration": true,
"enabled": true
}
},
"buttonText": "Login with Facebook",
"client_secret": "72417eb5aa454ef2373b361d721cb074",
"enabled": true,
"fields": "email",
"id": "56abdcc7-8bd9-4321-9621-4e9bbebae494",
"insertInstant": 1595361142909,
"lastUpdateInstant": 1595361143101,
"name": "Facebook",
"permissions": "email,profile_image",
"type": "Facebook"
},
{
"applicationConfiguration": {
"1c212e59-0d0e-6b1a-ad48-f4f92793be32": {
"createRegistration": true,
"enabled": true
}
},
"buttonText": "Login with Google",
"client_id": "254311943570-8e2i2hds0qdnee4124socceeh2q2mtjl.apps.googleusercontent.com",
"client_secret": "BRr7x7xz_-cXxIFznBDIdxF1",
"enabled": true,
"id": "82339786-3dff-42a6-aac6-1f1ceecb6c46",
"insertInstant": 1595361142909,
"lastUpdateInstant": 1595361143101,
"name": "Google",
"scope": "profile",
"type": "Google"
},
{
"applicationConfiguration": {
"1c212e59-0d0e-6b1a-ad48-f4f92793be32": {
"createRegistration": true,
"enabled": true
}
},
"buttonText": "Login with Twitter",
"consumerKey": "24iuleLRKIZUNhxuuUK6yDZwb",
"consumerSecret": "e2ZpAaAfxv2j9eeh6JTeNcXMWdVLjRNriXm4wSZt1f1Ss3Syp4",
"enabled": true,
"id": "45bb233c-0901-4236-b5ca-ac46e2e0a5a5",
"insertInstant": 1595361142909,
"lastUpdateInstant": 1595361143101,
"name": "Twitter",
"type": "Twitter"
}
]
}Search for Identity Providers#
Available since1.45.0
This API is used to search for Identity Providers and may be called using the GET or POST HTTP methods. Examples of each are provided below. The POST method is provided to allow for a richer request object without worrying about exceeding the maximum length of a URL. Calling this API with either the GET or POST HTTP method will provide the same search results given the same query parameters.
Request#
Send the search criteria as query parameters on a GET request or as a JSON body on a POST request.
OpenAPI Spec
Query Parameters#
applicationIdRestricts the results to Identity Providers that are enabled for the given Application.
nameThe case-insensitive string to search for in the Identity Provider name. The string can contain wildcards using the asterisk character (*). When the string contains no wildcards, FusionAuth interprets the value as *value*. To match a literal asterisk, use two asterisks (**).
numberOfResultsThe number of results to return from the search.
orderByThe field and the order direction to sort the search results by.
The possible values are:
enabled: Whether the Identity Provider is enabled globally.id: The unique Id of the Identity Provider.insertInstant: The instant when FusionAuth created the Identity Provider.name: The Identity Provider name.source: The source of the Identity Provider. Available since1.65.0tenantId: The Id of the Tenant that the Identity Provider belongs to.type: The type of the Identity Provider.
The order direction is optional. The possible order directions are ASC and DESC. When you omit the order direction, FusionAuth sorts in ASC order.
For example, to order the results by insert instant in descending order, use insertInstant DESC.
startRowThe offset into the total results. To paginate the results, increment this value by numberOfResults for each subsequent request.
For example, when the total search results exceed the page size that numberOfResults sets, set this value to 25 to retrieve results 26-50. The example assumes the default page size.
sourceThe case-insensitive string to search for in the Identity Provider source. The string can contain wildcards using the asterisk character (*). When the string contains no wildcards, FusionAuth interprets the value as *value*. To match a literal asterisk, use two asterisks (**).
tenantIdRestricts the results to Identity Providers that belong to the given Tenant. An X-FusionAuth-TenantId header on the request overrides this parameter. An API Key scoped to a specific Tenant also overrides this parameter.
typeThe type of Identity Provider to return.
The possible values are:
AppleEpicGamesExternalJWTFacebookGoogleHYPRLinkedInNintendoOpenIDConnectSAMLv2SAMLv2IdPInitiatedSonyPSNSteamTwitchTwitterXbox
OpenAPI Spec
When calling the API using a POST request you will send the search criteria in a JSON request body.
Request Body#
search.applicationId Restricts the results to Identity Providers that are enabled for the given Application.
search.name The case-insensitive string to search for in the Identity Provider name. The string can contain wildcards using the asterisk character (*). When the string contains no wildcards, FusionAuth interprets the value as *value*. To match a literal asterisk, use two asterisks (**).
search.numberOfResults The number of results to return from the search.
search.orderBy The field and the order direction to sort the search results by.
The possible values are:
enabled: Whether the Identity Provider is enabled globally.id: The unique Id of the Identity Provider.insertInstant: The instant when FusionAuth created the Identity Provider.name: The Identity Provider name.source: The source of the Identity Provider. Available since1.65.0tenantId: The Id of the Tenant that the Identity Provider belongs to.type: The type of the Identity Provider.
The order direction is optional. The possible order directions are ASC and DESC. When you omit the order direction, FusionAuth sorts in ASC order.
For example, to order the results by insert instant in descending order, use insertInstant DESC.
search.startRow The offset into the total results. To paginate the results, increment this value by numberOfResults for each subsequent request.
For example, when the total search results exceed the page size that numberOfResults sets, set this value to 25 to retrieve results 26-50. The example assumes the default page size.
search.source The case-insensitive string to search for in the Identity Provider source. The string can contain wildcards using the asterisk character (*). When the string contains no wildcards, FusionAuth interprets the value as *value*. To match a literal asterisk, use two asterisks (**).
search.tenantId Restricts the results to Identity Providers that belong to the given Tenant. An X-FusionAuth-TenantId header on the request overrides this parameter. An API Key scoped to a specific Tenant also overrides this parameter.
search.type The type of Identity Provider to return.
The possible values are:
AppleEpicGamesExternalJWTFacebookGoogleHYPRLinkedInNintendoOpenIDConnectSAMLv2SAMLv2IdPInitiatedSonyPSNSteamTwitchTwitterXbox
{
"search": {
"applicationId": "1c212e59-0d0e-6b1a-ad48-f4f92793be32",
"name": "twit",
"numberOfResults": 25,
"orderBy": "insertInstant",
"startRow": 0
}
}Response#
The response for this API contains the Identity Providers matching the search criteria in paginated format and the total number of results matching the search criteria.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
Response Body#
The response JSON can include different types of Identity Providers. For the response JSON format of a type, see the Retrieve section in the documentation for that Identity Provider type. This API uses the same format.
identityProvidersThe list of Identity Provider objects.
totalThe total number of Identity Providers that match the search criteria. To paginate, use this value with numberOfResults and startRow in the search request.
{
"identityProviders": [
{
"applicationConfiguration": {
"1c212e59-0d0e-6b1a-ad48-f4f92793be32": {
"createRegistration": true,
"enabled": true
}
},
"buttonText": "Login with Twitter",
"consumerKey": "24iuleLRKIZUNhxuuUK6yDZwb",
"consumerSecret": "e2ZpAaAfxv2j9eeh6JTeNcXMWdVLjRNriXm4wSZt1f1Ss3Syp4",
"enabled": true,
"id": "45bb233c-0901-4236-b5ca-ac46e2e0a5a5",
"insertInstant": 1595361142909,
"lastUpdateInstant": 1595361143101,
"name": "Twitter",
"type": "Twitter"
}
],
"total": 1
}Lookup an Identity Provider#
The Lookup API is intended to be used during an external login workflow.
For example, you might build your own login page. This page might collect the user's email as the first step. That email address can be sent to this API to determine which identity provider was designated as the provider for this email address. If the identity provider is an OpenID Connect provider, then you might redirect the user over to that provider.
Request#
Look up the Identity Provider that manages a given email domain or address.
OpenAPI Spec
Query Parameters#
domainThe email domain or the full email address of the user.
For example,
jenny@acme.comandacme.comare functionally equivalent.
tenantIdIf provided, the API searches for an identity provider scoped to the corresponding tenant that manages the requested domain. If no result is found, the API then searches for global identity providers.
Omitting this parameter will only search global identity providers.
Response#
The Lookup response is a subset of the Identity Provider configurations that would be returned by the identity provider retrieve operation. A 200 response code indicates the domain is managed and the response will contain a JSON body, a 404 response code indicates it is not managed by a configured Identity Provider.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 404 | The requested domain is not being managed by a configured Identity Provider. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
Example Response JSON#
identityProvider.applicationIds The list of Application Ids that are enabled for this Identity Provider.
identityProvider.id The unique Id of the Identity Provider.
identityProvider.idpEndpoint The configured SAML v2 endpoint. FusionAuth returns this value only for a SAML v2 Identity Provider. You can use this value to build the SAML request, so you don't need to hard code the endpoint in your application.
identityProvider.name The name of the Identity Provider.
identityProvider.oauth2.authorization_endpoint The OAuth2 Authorize endpoint. You can use this value as the redirect location to begin the authorize workflow, so you don't need to hard code the endpoint in your application. FusionAuth returns this value only for an External JWT or OpenID Connect Identity Provider.
identityProvider.oauth2.token_endpoint The OAuth2 Token endpoint. You can use this value during your integration, so you don't need to hard code the URI in your application. FusionAuth returns this value only for an External JWT or OpenID Connect Identity Provider.
identityProvider.tenantId The Id of the Tenant that a Tenant-scoped Identity Provider belongs to. The response leaves out the value for a global IdP.
identityProvider.type The type of the Identity Provider.
{
"identityProvider": {
"applicationIds": [
"0d5244df-053c-4ff6-b2db-1e04c388dae3"
],
"id": "a4e78daa-33a6-4844-b081-7779af1f09a4",
"name": "Acme Corp. ADFS OpenID Connect",
"oauth2": {
"authorization_endpoint": "https://acme.com/adfs/oauth2/authorize?client_id=cf3b00da-9551-460a-ad18-33232e6cbff0&response_type=code&redirect_uri=https://acme.com/oauth2/redirect",
"token_endpoint": "https://acme.com/adfs/oauth2/token"
},
"type": "OpenIDConnect"
}
}{
"identityProvider": {
"applicationIds": [
"0d5244df-053c-4ff6-b2db-1e04c388dae3"
],
"id": "d94f81eb-287b-466a-ac6a-fb29c83f598c",
"idpEndpoint": "https://login.microsoftonline.com/475bffef-4669-4e64-8f6c-b1ff41f16242/saml2",
"name": "Acme Corp. SAML v2 ADFS",
"type": "SAMLv2"
}
}Related
Learn about the APIs for creating, retrieving, updating and disabling a Facebook identity provider.
Learn about the APIs for creating, retrieving, updating and disabling a Google identity provider.
Learn about the APIs for creating, retrieving, updating and disabling a LinkedIn identity provider.
Learn about the APIs for creating, retrieving, updating and deleting OpenID Connect identity providers.