External JWT Identity Provider APIs

1. Overview

This API has been available since 1.1.0

This is a special type of identity provider that is only used via the JWT Reconcile API. This identity provider defines the claims inside the incoming JWT and how they map to fields in the FusionAuth User object.

In order for this identity provider to use the JWT, it also needs the public key or HMAC secret that the JWT was signed with. FusionAuth will verify that the JWT is valid and has not expired. Once the JWT has been validated, FusionAuth will reconcile it to ensure that the User exists and is up-to-date.

1.1. Operations

2. Create an External JWT Identity Provider

2.1. Request

Create an Identity Provider using a randomly generated id

URI

POST /api/identity-provider

Create an Identity Provider with the provided unique id

URI

POST /api/identity-provider/{identityProviderId}

Table 1. Request Parameters

identityProviderId [UUID] Optional defaults to secure random UUID

The Id to use for the new Identity Provider. If an id is not provided, a secure random UUID is generated.

Table 2. Request Body

identityProvider.applicationConfiguration [Map<UUID, Object>] Optional

The configuration for each Application that the identity provider is enabled for.

identityProvider.applicationConfiguration[applicationId].createRegistration [boolean] Optional defaults to true

Determines if a UserRegistration is created for the User automatically or not. If a user doesn’t exist in FusionAuth and logs in through an identity provider, this boolean controls whether or not FusionAuth creates a registration for the User in the Application they are logging into.

identityProvider.applicationConfiguration[applicationId].enabled [boolean] Optional defaults to false

Determines if this identity provider is enabled for the Application specified by the applicationId key.

identityProvider.claimMap [Map<String, String>] Optional

A map of incoming claims to User fields, User data or Registration data. The key of the map is the incoming claim name from the configured identity provider. The following are allowed values:

  • birthDate

  • firstName

  • lastName

  • fullName

  • middleName

  • mobilePhone

  • imageUrl

  • timezone

  • UserData

  • RegistrationData

identityProvider.enabled [Boolean] Optional defaults to false

Determines if this provider is enabled. If it is false then it will be disabled globally.

identityProvider.domains [Array<String>] Optional

An array of domains that are managed by this Identity Provider.

identityProvider.headerKeyParameter [String] Required

The name header claim that identifies the public key used to verify the signature. In most cases this be kid or x5t.

identityProvider.keys [Map<String, String>] Optional

A map of public keys used to verify JWT signatures issued from the configured Identity Provider. The key is the key identifier, this may be referred to as the kid or for X.509 certificates the x5t claim may be used.

The map may contain one entry with an empty map key. When provided this key will be used when no header claim is provided to indicate which public key should be used to verify the signature. Generally speaking this will only be used when the Identity Provider issues JWTs without a key identifier in the header.

identityProvider.name [String] Required

The name of the Identity Provider.

identityProvider.oauth2.authorization_endpoint [String] Optional

The authorization endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to perform the browser redirect to the OAuth2 authorize endpoint.

identityProvider.oauth2.token_endpoint [String] Optional

The token endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to complete the OAuth2 grant workflow.

identityProvider.type [String] Required

This field must be set to ExternalJWT.

identityProvider.uniqueIdentityClaim [String] Required

The name of the claim that represents the unique identify of the User. This will generally be email or the name of the claim that provides the email address.

Example Request JSON
{
  "identityProvider": {
    "claimMap": {
      "first_name": "firstName",
      "last_name": "lastName",
      "dept": "RegistrationData"
    },
    "domains": [
      "acme.com",
      "acme.org"
    ],
    "headerKeyParameter" : "kid",
    "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"
  }
}

2.2. Response

Table 3. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

503

The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Table 4. Response Body

identityProvider.applicationConfiguration [Map<UUID, Object>]

The configuration for each Application that the identity provider is enabled for.

identityProvider.applicationConfiguration[applicationId].createRegistration [boolean]

Determines if a UserRegistration is created for the User automatically or not. If a user doesn’t exist in FusionAuth and logs in through an identity provider, this boolean controls whether or not FusionAuth creates a registration for the User in the Application they are logging into.

identityProvider.applicationConfiguration[applicationId].enabled [boolean]

Determines if this identity provider is enabled for the Application specified by the applicationId key.

identityProvider.claimMap [Map<String, String>]

A map of incoming claims to User fields, User data or Registration data. The key of the map is the incoming claim name from the configured identity provider. The following are allowed values:

  • birthDate

  • firstName

  • lastName

  • fullName

  • middleName

  • mobilePhone

  • imageUrl

  • timezone

  • UserData

  • RegistrationData

identityProvider.enabled [Boolean]

Determines if this provider is enabled. If it is false then it will be disabled globally.

identityProvider.domains [Array<String>]

An array of domains that are managed by this Identity Provider.

identityProvider.headerKeyParameter [String]

The name header claim that identifies the public key used to verify the signature. In most cases this be kid or x5t.

identityProvider.id [UUID]

The unique identifier for the identity provider.

identityProvider.keys [Map<String, String>]

A map of public keys used to verify JWT signatures issued from the configured Identity Provider. The key is the key identifier, this may be referred to as the kid or for X.509 certificates the x5t claim may be used.

The map may contain one entry with an empty map key. When provided this key will be used when no header claim is provided to indicate which public key should be used to verify the signature. Generally speaking this will only be used when the Identity Provider issues JWTs without a key identifier in the header.

identityProvider.name [String]

The name of the Identity Provider.

identityProvider.oauth2.authorization_endpoint [String]

The authorization endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to perform the browser redirect to the OAuth2 authorize endpoint.

identityProvider.oauth2.token_endpoint [String]

The token endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to complete the OAuth2 grant workflow.

identityProvider.type [String]

This field will always be set to ExternalJWT.

identityProvider.uniqueIdentityClaim [String]

The name of the claim that represents the unique identify of the User. This will generally be email or the name of the claim that provides the email address.

Example Response JSON
{
  "identityProvider": {
    "claimMap": {
      "first_name": "firstName",
      "last_name": "lastName",
      "dept": "RegistrationData"
    },
    "domains": [
      "acme.com",
      "acme.org"
    ],
    "headerKeyParameter" : "kid",
    "id" : "a4e78daa-33a6-4844-b081-7779af1f09a4",
    "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"
  }
}

3. Retrieve an External JWT Identity Provider

3.1. Request

Retrieve an external JWT Identity Provider by Id

URI

GET /api/identity-provider/{identityProviderId}

Table 5. Request Parameters

identityProviderId [UUID] Required

The unique Id of the Identity Provider to retrieve.

3.2. Response

Table 6. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

404

The object you requested doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

503

The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Table 7. Response Body

identityProvider.applicationConfiguration [Map<UUID, Object>]

The configuration for each Application that the identity provider is enabled for.

identityProvider.applicationConfiguration[applicationId].createRegistration [boolean]

Determines if a UserRegistration is created for the User automatically or not. If a user doesn’t exist in FusionAuth and logs in through an identity provider, this boolean controls whether or not FusionAuth creates a registration for the User in the Application they are logging into.

identityProvider.applicationConfiguration[applicationId].enabled [boolean]

Determines if this identity provider is enabled for the Application specified by the applicationId key.

identityProvider.claimMap [Map<String, String>]

A map of incoming claims to User fields, User data or Registration data. The key of the map is the incoming claim name from the configured identity provider. The following are allowed values:

  • birthDate

  • firstName

  • lastName

  • fullName

  • middleName

  • mobilePhone

  • imageUrl

  • timezone

  • UserData

  • RegistrationData

identityProvider.enabled [Boolean]

Determines if this provider is enabled. If it is false then it will be disabled globally.

identityProvider.domains [Array<String>]

An array of domains that are managed by this Identity Provider.

identityProvider.headerKeyParameter [String]

The name header claim that identifies the public key used to verify the signature. In most cases this be kid or x5t.

identityProvider.id [UUID]

The unique identifier for the identity provider.

identityProvider.keys [Map<String, String>]

A map of public keys used to verify JWT signatures issued from the configured Identity Provider. The key is the key identifier, this may be referred to as the kid or for X.509 certificates the x5t claim may be used.

The map may contain one entry with an empty map key. When provided this key will be used when no header claim is provided to indicate which public key should be used to verify the signature. Generally speaking this will only be used when the Identity Provider issues JWTs without a key identifier in the header.

identityProvider.name [String]

The name of the Identity Provider.

identityProvider.oauth2.authorization_endpoint [String]

The authorization endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to perform the browser redirect to the OAuth2 authorize endpoint.

identityProvider.oauth2.token_endpoint [String]

The token endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to complete the OAuth2 grant workflow.

identityProvider.type [String]

This field will always be set to ExternalJWT.

identityProvider.uniqueIdentityClaim [String]

The name of the claim that represents the unique identify of the User. This will generally be email or the name of the claim that provides the email address.

Example Response JSON
{
  "identityProvider": {
    "claimMap": {
      "first_name": "firstName",
      "last_name": "lastName",
      "dept": "RegistrationData"
    },
    "domains": [
      "acme.com",
      "acme.org"
    ],
    "headerKeyParameter" : "kid",
    "id" : "a4e78daa-33a6-4844-b081-7779af1f09a4",
    "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"
  }
}

4. Update an External JWT Identity Provider

4.1. Request

Update an Identity Provider

URI

PUT /api/identity-provider/{identityProviderId}

Table 8. Request Parameters

identityProviderId [UUID] Required

The unique Id of the Identity Provider to update.

Table 9. Request Body

identityProvider.applicationConfiguration [Map<UUID, Object>] Optional

The configuration for each Application that the identity provider is enabled for.

identityProvider.applicationConfiguration[applicationId].createRegistration [boolean] Optional defaults to true

Determines if a UserRegistration is created for the User automatically or not. If a user doesn’t exist in FusionAuth and logs in through an identity provider, this boolean controls whether or not FusionAuth creates a registration for the User in the Application they are logging into.

identityProvider.applicationConfiguration[applicationId].enabled [boolean] Optional defaults to false

Determines if this identity provider is enabled for the Application specified by the applicationId key.

identityProvider.claimMap [Map<String, String>] Optional

A map of incoming claims to User fields, User data or Registration data. The key of the map is the incoming claim name from the configured identity provider. The following are allowed values:

  • birthDate

  • firstName

  • lastName

  • fullName

  • middleName

  • mobilePhone

  • imageUrl

  • timezone

  • UserData

  • RegistrationData

identityProvider.enabled [Boolean] Optional defaults to false

Determines if this provider is enabled. If it is false then it will be disabled globally.

identityProvider.domains [Array<String>] Optional

An array of domains that are managed by this Identity Provider.

identityProvider.headerKeyParameter [String] Required

The name header claim that identifies the public key used to verify the signature. In most cases this be kid or x5t.

identityProvider.keys [Map<String, String>] Optional

A map of public keys used to verify JWT signatures issued from the configured Identity Provider. The key is the key identifier, this may be referred to as the kid or for X.509 certificates the x5t claim may be used.

The map may contain one entry with an empty map key. When provided this key will be used when no header claim is provided to indicate which public key should be used to verify the signature. Generally speaking this will only be used when the Identity Provider issues JWTs without a key identifier in the header.

identityProvider.name [String] Required

The name of the Identity Provider.

identityProvider.oauth2.authorization_endpoint [String] Optional

The authorization endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to perform the browser redirect to the OAuth2 authorize endpoint.

identityProvider.oauth2.token_endpoint [String] Optional

The token endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to complete the OAuth2 grant workflow.

identityProvider.type [String] Required

This field must be set to ExternalJWT.

identityProvider.uniqueIdentityClaim [String] Required

The name of the claim that represents the unique identify of the User. This will generally be email or the name of the claim that provides the email address.

Example Request JSON
{
  "identityProvider": {
    "claimMap": {
      "first_name": "firstName",
      "last_name": "lastName",
      "dept": "RegistrationData"
    },
    "domains": [
      "acme.com",
      "acme.org"
    ],
    "headerKeyParameter" : "kid",
    "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"
  }
}

4.2. Response

The response for this API contains the external JWT Identity Provider that was updated.

Table 10. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

404

The object you are trying to updated doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

503

The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Table 11. Response Body

identityProvider.applicationConfiguration [Map<UUID, Object>]

The configuration for each Application that the identity provider is enabled for.

identityProvider.applicationConfiguration[applicationId].createRegistration [boolean]

Determines if a UserRegistration is created for the User automatically or not. If a user doesn’t exist in FusionAuth and logs in through an identity provider, this boolean controls whether or not FusionAuth creates a registration for the User in the Application they are logging into.

identityProvider.applicationConfiguration[applicationId].enabled [boolean]

Determines if this identity provider is enabled for the Application specified by the applicationId key.

identityProvider.claimMap [Map<String, String>]

A map of incoming claims to User fields, User data or Registration data. The key of the map is the incoming claim name from the configured identity provider. The following are allowed values:

  • birthDate

  • firstName

  • lastName

  • fullName

  • middleName

  • mobilePhone

  • imageUrl

  • timezone

  • UserData

  • RegistrationData

identityProvider.enabled [Boolean]

Determines if this provider is enabled. If it is false then it will be disabled globally.

identityProvider.domains [Array<String>]

An array of domains that are managed by this Identity Provider.

identityProvider.headerKeyParameter [String]

The name header claim that identifies the public key used to verify the signature. In most cases this be kid or x5t.

identityProvider.id [UUID]

The unique identifier for the identity provider.

identityProvider.keys [Map<String, String>]

A map of public keys used to verify JWT signatures issued from the configured Identity Provider. The key is the key identifier, this may be referred to as the kid or for X.509 certificates the x5t claim may be used.

The map may contain one entry with an empty map key. When provided this key will be used when no header claim is provided to indicate which public key should be used to verify the signature. Generally speaking this will only be used when the Identity Provider issues JWTs without a key identifier in the header.

identityProvider.name [String]

The name of the Identity Provider.

identityProvider.oauth2.authorization_endpoint [String]

The authorization endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to perform the browser redirect to the OAuth2 authorize endpoint.

identityProvider.oauth2.token_endpoint [String]

The token endpoint for this Identity Provider. This value is not utilized by FusionAuth is only provided to be returned by the Lookup Identity Provider API response. During integration you may then utilize this value to complete the OAuth2 grant workflow.

identityProvider.type [String]

This field will always be set to ExternalJWT.

identityProvider.uniqueIdentityClaim [String]

The name of the claim that represents the unique identify of the User. This will generally be email or the name of the claim that provides the email address.

Example Response JSON
{
  "identityProvider": {
    "claimMap": {
      "first_name": "firstName",
      "last_name": "lastName",
      "dept": "RegistrationData"
    },
    "domains": [
      "acme.com",
      "acme.org"
    ],
    "headerKeyParameter" : "kid",
    "id" : "a4e78daa-33a6-4844-b081-7779af1f09a4",
    "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"
  }
}

5. Delete an External JWT Identity Provider

5.1. Request

Delete an Identity Provider by Id

URI

DELETE /api/identity-provider/{identityProviderId}

Table 12. Request Parameters

identityProviderId [UUID] Required

The unique Id of the Identity Provider to delete.

5.2. Response

This API does not return a JSON response body.

Table 13. Response Codes
Code Description

200

The request was successful. The response will be empty.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

404

The object you are trying to delete doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

503

The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.