Overview
ID.me uses OpenID Connect (OIDC), built on top of OAuth 2.0 RFC6749, to authorize access to its APIs. OIDC is an open authentication protocol
that enables secure user sign-in and identity data exchange. To access a user’s data, your application must include both an access_token
and an
id_token
in requests to ID.me’s REST API. These tokens are unique to each user, must be stored securely, and the access_token
expires 5 minutes
after issuance.
ID.me supports both full-page redirects and popup windows for the authorization flow. After registering your application, you’ll find sample code, documentation, and options to upload your company logo and customize the button colors within the ID.me interface.
Prerequisites
ID.me developer account
To get started, create an ID.me developer account and set up your organization. This will generate your client_id and client_secret.
Once your application is registered, you can configure one or more redirect_uri
values to define where ID.me should return the authorization_code
.
Evaluate well-known endpoints
Use the well-known endpoint to retrieve standardized configuration metadata. This JSON-formatted response includes critical details such as:
- The issuer URL
- Supported authentication methods
- Token endpoint
- Public key for verifying tokens
- Other essential configuration settings
This metadata allows you to configure your application for secure authentication and authorization, ensuring compatibility with the OpenID Connect (OIDC) standard.
Direct users to authorization endpoint
To start the OAuth process, your client application must redirect the user to the ID.me authorization endpoint. There, the user signs in and chooses whether to grant your application access.
Authorization endpoint
Parameters
Receive authorization code
When a user completes the authorization process on ID.me, they will be redirected to your redirect_uri
with the authorization code parameter appended.
Redirect URI with code example
Exchange authorization code for token payload
Using the authorization code from the previous step, send a request to ID.me’s Token Endpoint (see below) to retrieve the payload containing your
access_token
and refresh_token
. Each token’s expiration can be found within the payload.
- Endpoint:
https://api.id.me/oauth/token
- Request method:
POST
- Response type: application/JSON
Parameters
CURL example
Important
Replace the CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, and SCOPE with your inputs
Obtain ID token
Parameters
Example payload
Validate ID token
To ensure the ID token was issued by a trusted source, you need to validate its JWT signature.
ID.me signs the token using the RS256 algorithm. To verify the signature, retrieve the public key from the OpenID Connect server. You can fetch this key from the JWKS endpoint:
This endpoint is referenced in the OIDC discovery document and available in the configuration settings of your developer dashboard.
Example JSON Web Token (JWT)
Decode ID token for user payload
The ID token contains details about the user and their authentication status. The following steps explain how to decode the token, which is formatted as a JSON Web Token (JWT), to extract the necessary user information.
Decoded header payload
Key descriptions
Decoded header payload example
Decoded ID token payload
Key descriptions
Decoded ID token payload example
Exchange access token for ID token
This step is optional and only necessary if you would like to use an ID token in place of the access token.
- Endpoint:
https://api.id.me/api/public/v3/userinfo
- Request method
GET
- Response type application/JSON
Parameters
CURL example
Example payload
Parse JSON response
Parsing the JSON response accurately is essential for building a scalable and reliable integration. How your application retrieves and handles this data will determine whether it can adapt to changes, such as the addition of new attributes, without breaking.
Best practice
-
Use the handle field to index attribute values
-
Validate only attributes that are included in the response
-
Store raw JSON responses for auditing and troubleshooting
-
Create a database table to store verification status,
uuid
, and authoritative data from the ID.me API -
Use the
uuid
as a foreign key to link user activity across your application -
Pre-fill form fields to improve the user experience after verification
-
Do not assume attributes or status values will be returned in a specific order
Example data types
The type of each attribute determines how data will be returned from the ID.me API. You may receive any of the following types.
String
Integer
Array
Object
Important
Do NOT assume that all attribute values will be strings