This workflow covers the different ways in which you can authenticate a player in order to check the assets that they have access to.
There are two sections to this guide:
- How to auth your user,
- How to validate that user has access/permissions to an asset (specifically an asset ID).
Get your users to perform one of the following functions to authenticate:
A user continues as a guest, to which they have then created a User ID and a wallet.
They can receive assets but do not have full ownership of their wallet until they claim it, either by entering their email address or connecting a custodial wallet (at which point their account is upgraded from "guest" to "user").
Create an account by entering your email address and verifying.
This will create the User ID and wallet.
The user has full access and ownership of their wallet, and by giving their email they are able to re-auth.
Enter your email and receive a login code.
Enter the code to auth.
You're now back in your previous Nefta User ID (NUID) and have access to your wallet.
Instead of creating or logging in via email, a user can create an account and subsequently login thereafter by connecting a custodial wallet (Metamask).
Auth with access to custodial wallet.
Once authenticated, simply ping Get Gamer Owned Assets in our API reference.
This quite simply gets all the assets owned by a gamer whose token is sent as authentication.
The endpoint includes an asset_id for every asset they own.
You should have saved which asset ID you need to validate.
Simply check for a match between the returned results from the user and the asset ID you're looking for.
Updated about 1 month ago