Registering Customers

Prerequisites

Before you implment customer registration you'll need to obtain credentials to fabric Customer. These credentials should be Client Credentials (for more information about obtaining client credentials, see here).

  1. Access to fabric Customer APIs
  2. Registered an app with fabric Identity
  3. OAuth2.0 Client Credentials for your registered app with fabric Identity

Implementation

To register customers with fabric Customer, using your own identity system is a two step process.

  1. Create a Customer User within fabric Customer.
  2. Create a Profile for that user within fabric Customer.

As fabric Customer does not hold any credentials to a user login, it is on your identity system to authenticate that a user is who they say they are.

Obtaining an access token

Using your client credentials make a call to https://domain/oauth/default/v1/token with your client credentials.

The Client Credentials should be passed to the Authorization header base64 encoded, seperated by : and prefixed withBasic.

const encodedClientCredentials = base64Encode('clientId' + ':' 'clientSecret');
request.setHeader('Authorization', 'Basic ' + encodedClientCredentials');

If the client credentials are correct you'll recieve the following response:

{
  "token_type": "string",
  "expires_in": 0,
  "access_token": "string",
  "id_token": "string",
  "scope": "string"
}