Prove Pre-Fill® and Prove Identity℠ SDK Guide
Learn more about the details of the server-side SDK.
Prove provides server-side SDKs in the following languages: Java, TypeScript/JavaScript, and Go. If you use a different backend language, you can easily interact with the REST APIs.
Installation
Install the server-side SDK of your choice by running a command in your terminal, or by using a dependency management tool specific to your project.
Prove provides code samples for how to interact with the API endpoints in many different languages. Browse the API Reference page and click your language from the top tabs.
OAuth for Authentication
In order to access the Prove API, you’ll need to provide your OAuth client ID and client secret.
You can load them from environment variables or another method:
Token Expiration
The OAuth token will expire after 60 minutes and you need to acquire another token.
Next Field
Each of the functions return a Next
field. This field is a map that tells you which function you need to call next.
Start()
Add an endpoint to your server (example: POST /initiate
) so the frontend/client code can submit the flow type, phone number, and challenge (either last four of SSN or date of birth). On the backend, you’ll start a Prove flow with a call to the Start()
function. This function takes these required parameters:
- Flow Type: either
desktop
ormobile
to describe which type of device the end user is starting their flow on.
Possession Timeouts
When flow type is desktop
, Instant Link performs the possession check. When flow type is mobile
, first Mobile Auth (if enabled) and then one-time password (OTP) as a fallback. The Instant Link session has a five minute timeout from when it’s sent via SMS to when the end user can click on the link successfully. The OTP session has a two minute timeout from when it’s sent via SMS to when the end user can enter in the OTP successfully.
- Final Target URL: only required when
Flow Type=desktop
. It can be either a Prove provided URL or your own URL that instructs the end user to close their mobile browser.
Optionally, pass one of these parameters:
-
ssn
: full or last four digits of the end user’s social security number. You can pass it intoStart()
orChallenge()
. -
dob
: date of birth in one of these formats:YYYY-MM-DD
,YYYY-MM
,MM-DD
. You can pass it intoStart()
orChallenge()
.
Here is an example:
The function returns the following fields:
-
Auth Token: send this to your client-side code via the Authenticate() function - it’s a short lived JSON Web Token (JWT) tied to the current flow and used to facilitate the possession checks.
-
Correlation ID: save this in your current session, you will pass it in to each of the
Validate()
,Challenge()
, andComplete()
function calls of the same flow. The correlation ID allows Prove to tie together different system calls for the same Prove flow. It can aids in troubleshooting. The session will expire in 15 minutes from when the correlation ID returns from the Start() call. -
Next: map of the next API call you need to make.
Return the auth token in a response to the frontend.
The phone number field is also required in Sandbox so the system knows which scenario you are testing. Neglecting to pass in the phone number of a valid test user will return an HTTP 400 (8007 - no test user found matching the phone number) error.
Validate()
Once the possession checks finish on the mobile device, the finish handler on the client SDK will execute, making a request to your server (for example: POST /verify
) to make the next call in the flow to the Validate() function.
This function takes only this required parameter:
- Correlation ID: this is the ID returned by the Start() function.
Here is an example:
The function returns the following fields:
-
Success: either
true
if the mobile number validation was successful, orfalse
if it failed. -
Challenge Missing:
true
if you need to pass the challenge into the Challenge() function. -
Phone Number: either the validated phone number or no field.
-
Next: map of the next API you need to call you need to make.
The challenge missing field determines if you need to return to the frontend and request an additional user input of either the last four of their social security number or date of birth. If the challenge was already passed into the Start() call (challengeMissing=false and next contains v3-challenge), the backend can then make a call to the Challenge() function and return the results to the frontend.
Challenge()
If the Validate() function returns v3-challenge
as one of the keys in the Next
field map, call the Challenge() function to return the user information matching the mobile number and challenge.
The Challenge() capability is only available in Prove Pre-Fill®. You’ll notice that when using Prove Identity®, if Validate() is successful, it will then return v3-complete
as one of the keys in the Next
field map instead of v3-challenge
.
This function takes has one required parameter:
- Correlation ID: this is the ID returned by the Start() function.
If the Validate() function returned Challenge Missing=true
, one of these parameters are also required:
-
ssn
: full or last four digits of the end user’s social security number. -
dob
: date of birth in one of these formats:YYYY-MM-DD
,YYYY-MM
,MM-DD
.
Here is an example:
The function returns the following fields:
-
Success:
true
if user info returned. -
Individual: user information in a map.
-
Next: map of the next API you need to call you need to make.
If the success field is true, return the user information in a response to the frontend to pre-fill the form.
Complete()
Once the end user reviews their information and makes any edits, they need to submit the user information to the backend (example: POST /finish
) for verification.
This function is the final call in the flow that verifies the user information.
This function takes these required parameters:
-
Correlation ID: this is the ID returned by the Start() function. It will validate against this RegEx:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
. -
Individual: user information in a map.
Here is an example:
The function returns the following fields:
-
Success:
true
if user information returned. -
Next: map of the next API you need to call you need to make - this will always have
Done
.
You can then respond to the frontend with the results of the user verification.
SDK Updates
Prove hosts the server SDKs on GitHub. Once you create a free GitHub account, you can Watch any of the projects to receive notifications when there are updates.