Off-Chain Access Control
Last updated
Last updated
To restrict access to specific features or functionalities on your website based on the KYC/AML status of the user, you need to implement off-chain access control.
[Backend] Configure the server to request and handle KYC/AML data from Authento.
[Frontend] Implement access control based on the status response returned from your backend.
[Backend] (Optional) Set up handlers for verification webhooks.
You have to set up a server which requests and handles KYC/AML data from Authento. The exact implementation depends on your use case. For example, you could configure your server to
Request KYC/AML status by wallet address upon user sign-in.
Confirm KYC/AML status when a user makes a withdrawal request.
Once the KYC/AML status is retrieved, it should be processed on your backend to derive the permissions which should be granted to the user.
The API response from Authento contains sensitive information and should NOT be directly relayed to the end user.
Instead, the API response should be used to derive user permissions server-side, and only such permissions should be sent back to the client.
Aside from restricting user access based on KYC status returned from your backend, your frontend should be set up to initialize Authento KYC on users' demand. You can do this using the authento-react package, or you can do this manually.
Take the following steps to initialize the Authento verification process manually:
Create a signature for the following typed structured data:
YOUR_DOMAIN_NAME
: Your domain name registered with Authento. Please contact us if you are unsure of its value.
CURRENT_TIMESTAMP
: The number of milliseconds elapsed since the Unix epoch as a string.
NONCE
: Randomly generated string as a safeguard against replay attacks. You can use uuid or other packages to generate this.
Upon successful generation of the signature, direct the user to
https://www.authento.io/verify/${YOUR_DOMAIN_NAME}
using a modal or a popup with the following query parameters:
address
: The EVM address to verify
ts
: CURRENT_TIMESTAMP as defined above
nonce
: NONCE as defined above
signature
: The signature generated
levelType
: "BASIC" or "POA"
The signature generated will be verified on Authento server to ensure the user's ownership of the address. There's no need to worry about malicious users attempting to register addresses for which they do not own the private key
Users will then proceed with the verification process on the newly opened modal or popup.
Generate an API key/secret pair from the under the Settings tab
For details on how KYC/AML status can be retrieved using the Authento API, please refer to the section.
This package contains custom react hooks which makes it very simple to integrate Authento into your platform. For detailed instructions or usage examples, please refer to .
On the library, the signature can be generated as follows:
In address-based verification, you are not assumed to be managing your own user database. In case you do, however, you can ensure that your user data is up to date by setting up an endpoint to handle and process webhooks data. For more information on webhooks, please refer to.