User Authentication

An authentication session is a process that allows you to authenticate an end user at any point in the process. The create.authentication API call generates a token that can be injected into the Brite JavaScript client to render the authentication as a standalone product. Once the authentication is successfully completed, the API call returns a customer_id that can be used to retrieve customer information. This article will provide a detailed guide on how to integrate the authentication session.

Integration

Initiate a client authentication session by making a POST request towards sessions.create_authentication.

				
					//example request
{
    "deeplink_redirect": "string",
    "country_id": "string",
    "callbacks": [
        {
            "url": "string",  // required
            "transaction_state": 1,
            "session_state": 1
        }
    ],
    "customer_firstname": "string",
    "customer_lastname": "string",
    "customer_dob": "string",
    "customer_id": "string",
    "customer_street_address": "string",
	"customer_zip": "string", 	
	"customer_city": "string",
	"customer_email": "string",
	"ssn": "string",
    "merchant_reference": "string",
	"locale": "string",
	"redirect_uri": "string",
	"brand_name": "string"  // required in DE
}
				
			

The deeplink_redirect is for mobile devices to redirect back to merchant app after authenticating with third party app.  This is useful to make sure that the expected user is making the deposit. The merchant_reference is set by the merchant

				
					// example response
{
    "url": "string",
    "token": "string",
    "id": "string"
}
				
			

In the response you will find a URL where the client is hosted. A token for rendering the client using the javascript. And an id for the session. 

Inject the token into the JavaScript client and render the client. After the customer has authenticated successfully in the client Brite sends a STATE_AUTHENTICATION_COMPLETE callback to the url stated for session_state; 2.

				
					// example request - callback
{
"transaction_state": 2,
"transaction_id": "string",
"merchant_id": "string"
}
				
			

Brite sends a STATE__COMPLETE callback to the url stated for session_state; 12

Call session.get using the session id to get session details.