How to integrate login-free service

Description

The login-free service is to generate the corresponding login-free URL based on the information received from your service when the user accesses Loyalty3.

Loyalty3 synchronizes the user's login status through the login-free URL generated by this interface.

Use Case

Users can access Loyalty3 from your application without the need to log in again. They can directly retrieve user-related information, such as claimed benefits/NFTs and eligibility status, without requiring reauthentication.

Development

The following is the overall flow of interaction between your service and Loyalty3:

To complete the integration, you need to complete the following steps, including:

  1. Configure the verify wallet address

  2. Construct request parameters, signature, redirect link

  3. Concatenate URLs

Step 1

Configure the address used for signature verification to ensure the legitimacy of your requests.

In Setting -> Developer Setting, configure the verify wallet address, which must be a ethereum address.

Step 2

Construct request parameters, signature, redirect link.

Parameters

Build the necessary parameters for each request, including:

Parameters
Type
Example
Description

account_id

string

0x6183b0e158e5e591b1d634E64861B8700F90ecb3

User unique identifier, corresponding to a single user and is immutable.

account_type

string

EVM_ADDRESS

Type of account, currently only supports EVM_ADDRESS.

project_id

string

91

The project ID assigned to you when you register with Loyalty3.

timestamp

number

1687766502

Current second-level Unix timestamp.

Example:

Signature

Sign using the verify wallet address set in Step 1, and the plaintext message needs to be processed similarly to signing with MetaMask.

Here is an example of constructing a signature:

The redirect link represents the URL of the page to which users will be redirected upon entering Loyalty3.

Example:

https://loyalty3.io/project/90/drop-detail/254

Step 3

Concatenate the URL with the parameters, signature, and redirect link constructed in Step 2.

NOTE: The order of the parameters can not be changed.

URL Example:

🎉 Congratulations! Through this URL, users will be redirected to the specified page and they can access Loyalty3 from your application without the need to log in again!

Frequently Asked Questions

I am unable to redirect properly. How can I know what the problem is?

You can know the issue by analyzing the returned error code.

Error Code

Description

INVALID_SIG

Incorrect signature.

INVALID_PARAM

Incorrect parameters.

PROJECT_NOT_EXIST

The project does not exist.

TOKEN_EXPIRED

The token has expired. Tokens are valid for 14 days.

How to obtain project_id?

  1. Login to your Loyalty3 account.

  2. Go to the "Setting" section.

  3. Navigate to the "Developer Setting" .

  4. Look for the project ID associated with your project.

Last updated