Overview
This guide introduces the ID.me OAuth 2.0 implementation and explains how partners can use it to access user data securely.
ID.me uses OAuth 2.0 RFC 6749 to authorize access to its APIs. To retrieve a user’s community data, your application must
obtain an access_token
. This token is user-specific, should be stored securely, and expires 5 minutes after issuance.
ID.me supports both full-page redirects and popup windows for the authorization flow. Once you’ve registered your application, you’ll find sample code, documentation, and the option to upload your company logo on the application details page.
Prerequisites
You will need an ID.me developer account to obtain the following:
- Client ID
- Client Secret
- Redirect URI
Direct users to authorization endpoint
To begin the OAuth flow, your client application must direct the user to the ID.me authorization endpoint. There, the user signs in to ID.me and is prompted to grant or deny access to your application.
Authorization endpoint
Important
Replace the CLIENT_ID, REDIRECT_URI, and SCOPE with your inputs
Parameters
Optional ID.me widget
Receive the authorization code
Once the 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 access token
After the user authorizes your application, exchange the authorization code for an access_token
and refresh_token
by sending a request to ID.me’s token endpoint.
The response payload includes both tokens and their expiration times.
-
Endpoint:
https://api.id.me/oauth/token
-
Method:
POST
-
Response type: application/JSON
Parameters
CURL example
Important
Replace the CLIENT_ID, REDIRECT_URI, and SCOPE with your inputs
Obtain access token
Parameters
Example payload
Exchange access token for user data
To retrieve user data, make an HTTP GET request to the protected endpoint below. Include the access_token
in the request. ID.me will validate the token to ensure it’s valid and has the required scope.
-
Endpoint:
https://api.id.me/api/public/v3/attributes.json
-
Method:
GET
-
Response type: application/JSON
Parameters
Example payload
Parse the JSON response
Properly parsing the JSON response is essential for building a scalable integration. How your application handles the response determines whether it can gracefully support future changes, such as the addition of new attributes, without breaking.
Best practice
- Use object handles to index attribute values
- Validate only attributes that are currently returned
- Store raw JSON responses for auditing and debugging
- 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 ID.me user activity across your application - Pre-fill form fields to streamline the post-verification user experience
Example data types
The attribute type determines what data type will be returned from ID.me’s REST API. The following data types are expected from ID.me’s REST API:
String
Integer
Array
Object
Important
Do NOT expect all attribute values to be a string