Authento API
  • Welcome to Authento
  • Integration Guidance
    • Introduction
    • Address-Based Verification
      • Off-Chain Access Control
      • On-Chain Access Control
        • Digital Signature Verification
        • Merkel Proof Verification
    • Account-Based Verification
    • Webhooks
  • API Reference
    • General Information
    • Endpoints
      • Get Basic User Info
      • Get Full User Info
  • Authento-react
    • Getting Started
    • useSignature
    • useStatus
    • useTokenVerifyPopup
    • useVerifyPopup
Powered by GitBook
On this page
  • Steps
  • Verification Tokens
  • Webhooks Handling
  1. Integration Guidance

Account-Based Verification

For projects which manage their own user databases

PreviousMerkel Proof VerificationNextWebhooks

Last updated 1 year ago

In the account-based verification flow, users are identified by server-generated unique identification strings. You should also manage your own user database, and keep it updated by fetching the latest user information using the Authento API upon receiving webhook notifications.

Steps

  1. Send us the list of IPs which should be granted dashboard/API access.

    • API key/secret

    • Webhook targetURL/secret

    • JWT secret

  2. [Backend] Set up handlers for verification token requests.

  3. [Backend] Set up handlers for verification webhooks.

Verification Tokens

Verification tokens are JSON web tokens (JWT) which contains information needed to initialize the account-based verification flows. They should be signed with the JWT secret configured on the Authento dashboard, and contain the following fields:

Key
Name
Description

iss

Issuer

sub

Subject

User Identifier; server-generated string unique to each user. This is used to associate users with their verification results.

aud

Audience

This should always be "Authento".

iat

Issued at

Unix timestamp in seconds when token is issued.

vt

Verification type

Either "BASIC" or "POA"

ut

User type

(Optional) Either "INDIVIDUAL" or "CORPORATE

lang

Language

(Optional) ISO 639-1 language code, defaults to "en"

The user identifier assigned to each of your user must be persistent and unique.

The user type value, if provided, affects the following:

  • Default user type - For new Authento users, their user type will be automatically set to the value specified in the token.

  • Required user type - For existing Authento users, verification will only proceed if the user type is equal to the value specified in the token.

Verification tokens can be easily generated using standard JWT libraries. Here are some examples:

import jwt from "jsonwebtoken";

const token = jwt.sign(
  {
    iss: CLIENT_NAME, // Obtained from Authento dashboard
    sub: USER_IDENTIFIER, // userIdentifier: identification string unique to each user
    aud: "Authento", // This should always be "Authento"
    ut: "INDIVIDUAL", // userType: "INDIVIDUA" | "CORPORATE"
    vt: "BASIC", // verificationType: "BASIC" | "POA"
    lang: "en", // (Optional) ISO 639-1 language code
  },
  AUTHENTO_JWT_SECRET // Obtained from Authento dashboard
);
import jwt

encoded = jwt.encode(
  {
    "iss": CLIENT_NAME, # Obtained from Authento dashboard
    "sub": USER_IDENTIFIER, # userIdentifier: identification string unique to each user
    "aud": "Authento", # This should always be "Authento"
    "ut": "INDIVIDUAL", # userType: "INDIVIDUA" | "CORPORATE"
    "vt": "BASIC", # verificationType: "BASIC" | "POA"
    "lang": "en", # (Optional) ISO 639-1 language code
  },
  AUTHENTO_JWT_SECRET, # Obtained from Authento dashboard, 
  algorithm="HS256"
)

To initialize a verification on the frontend using the generated token, you can either:

  • Open a popup and redirect the user to app.authento.io/verify/token?jwt={generatedToken}

Webhooks Handling

In account-based verification, webhooks are sent to a preconfigured target URL upon occurrence of events such as initialization or completion of verifications. You can then fetch the latest user information from the appropriate endpoint and update your user records.

Configure the following on the under the Settings tab:

Domain name, obtained from .

A list of Libraries for signing/verifying JWTs can be found .

Backend examples for verification token generation can be found .

(Recommended) Make use of the hook from the Authento-react library as shown in this

For more information, please refer to the section.

Authento Dashboard
here
here
useTokenVerifyPopup
example
webhooks
Authento Dashboard
Account-based verification