Identity Management
Overview
Identity management caters for authentication needs arising in the subscription and subscription retention management business.
Its main functions include:
- Registration - the registration form (with consents approval) for new subscribers (who don't have an account yet)
- Login - the login form for existing subscribers (who already have an account)
- Forgot Password - the ability to reset a password
- Cleeng Capture - an amazing tool that will help you understand your viewers through building customer profiles.
Registration
A customer who doesn't have an account yet needs to be registered.
The registration process involves the following steps:
1. Provide Metadata
To register customers you need to specify:
- the customer country (to calculate tax),
- currency,
- locale (which defines language and text formatting).
To get this data, you can request from the frontend to /locales
. This data is defined based on the IP address of the request.
2. Fetch Publisher's Consents
There are two types of consents:
- terms & conditions (both Cleeng's and the publisher's ones)
- marketing options (if applicable)
You can manage consents in Admin&Tools -> Capture and fetch them by /publishers/:publisherId/consents
.
3. Display Registration Form with Consents
The registration form should include at least email and password fields and checkboxes for terms & conditions and marketing options.
You shouldn't register the customer if she/he hasn't accepted the terms and conditions.
4. Register Customer
If the registration form has been completed correctly, the customer can be registered.
To register the customer use: /customers
After successful registration, the server generates JWT and a refresh token.
JWT is used for authorisation to all endpoints.
Thanks to a refresh token, an expired JWT can be replaced with a new JWT.
For more information on a refresh token please refer to the Refresh token section.
Cleeng saves a customer's registration date in the background. You can review this date in Customer Accounts page or by fetching customer's data. If a customer has not logged in yet, this date will be also used as the 'last login date'.
5. Update Customer's Consents
After successful registration, submit the selected consents by request to /customers/:customerId/consents
.
5. Testing
Registered customers are shown in the 'Customer Accounts' dashboard.
Go to 'Customer Accounts' page on sandbox or production.
With the registration flow ready, let's move on to the Login section.
Login
Customers can be logged in using offerId
or publisherId
:
offerId
- use login withofferId
if the customer has already chosen an offerpublisherId
- usepublisherId
if you want to enable choosing an offer after login.
Call /auths
method to log in the customer.
In response, you will get JWT (authorization token), a refresh token and customerToken (you may need customerToken
to use other Cleeng APIs).
After logging, you should check consents to make sure that the customer has accepted the latest version. To do so use Fetch customer's consents.
Cleeng saves a customer's last login date in the background. You can review this date in Customer Accounts page or by fetching customer's data. It will be set up after registration and updated after each login.
Single Sign-on
Broadcasters who use MediaStore SDK-based solution (Checkout, My Account) with an external identity management system as the primary identity provider can use the Single Sign-on (SSO) feature.
Now that you've enabled customers to log in, let's provide for the situation when they forget their password.
Forgot Password
If the viewer doesn’t remember the password, he/she can reset it.
Data required for password reset:
- customer email and
offerId
orpublisherId
(to identify the customer with the publisher).
This feature can also be used to reset the password in My Account -> User Profile Management.
Default Reset Password Page
If you use a default reset password page, the password reset process is as follows:
- Make a request to
/customers/passwords
. - An email with a reset password link will be sent to the given email.
- By following the link, the viewer will be able to reset to a new password.
Please note that by default, the link will redirect the customer to the default reset password page.
Custom Reset Password Page
If you use a custom password page, the password reset process is as follows:
- Make a request to
/customers/passwords
withresetUrl
param. - An email with a reset password link will be sent to the given email.
- By following the link, the viewer will be redirected to a given
resetUrl
where he/she should be able to provide a new password (resetPasswordToken
will be added toresetUrl
as a query param). - Update customer password by using
/customers/passwords
endpoint.
Great, you now have the basic features ready: your customers will be able to register to your service, log in and reset their password if they forget it.
Now you can go on and explore an extremely useful feature of Cleeng Capture.
Cleeng Capture
Cleeng Capture will help you to understand your viewers by building customer profiles. Integrate with Cleeng Capture to collect more data about customers and maintain the process easily.
Note
The capture form should be displayed:
- After registration as an additional step
- After login, if there is any setting that is enabled, required, and hasn't been answered by the customer
- In My Account, to enable answers update
Activate Cleeng Capture
You can simply get the Cleeng Capture to be working in 3 steps:
-
Step 1: Go to dashboard, Click through Admin & Tools, and choose Capture to enable Cleeng Capture (Terms & Conditions and marketing options are part of "Consents", not "Capture". You can fetch them with this endpoint.
-
Step 2: Simply select which data you would like to ask for, which should be required, and so on.
-
Step 3: Use endpoints to fetch Capture status and to save customer answers.
Pay attention to the field 'shouldCaptureBeDisplayed' as it will help you to decide if you should show the Capture form - it checks if there is any field that is enabled, required, and hasn't been answered by the selected customer. It's worth basing on this field, not to miss any customer who registered before Cleeng Capture has been enabled or before changes to settings have been implemented. Moreover, remember that you can save answers only for the fields that are enabled.
Capture is designed to be used after authorization to collect data and in My Account to update them. Capture has to be used after registration, as endpoint requires authorization.
Up Next
Now that your customers can easily register and log in to your service, make sure the offers you want to sell are displayed properly. Let's continue with Offer Display.
Updated about 1 year ago