JWT Authentication Flow
Wallet Login-Based Integration
Mojito loyalty supports a wallet login-based integration, enabling users to securely access their accounts using their cryptocurrency wallets. This approach ensures seamless authentication and account management.
✨ Key Features
Secure Authentication: Users log in with their wallets, eliminating the need for passwords.
User Ownership: Ensure account access is tied directly to the user's wallet.
Simplified Onboarding: No additional signup process for wallet users.
🔧 Integration Steps
- Set Up Wallet Login Flow
Integrate Loyalty wallet authentication API into your application:- Present users with the option to log in via their wallet.
- Use supported wallet connectors (e.g., SUI wallet, ZKLogin).
- Generate a unique nonce for the user during the login attempt.
- Authentication Process
- Generate Nonce request from Signature API
- Sign the Nonce
Prompt the user to sign the provided nonce using their wallet - Verify Signature
Send the signed nonce to Loyalty API for verification
- Access Secured Endpoints
Use the bearer token received from the login api to authenticate requests to secured endpoints. Include the token in the Authorization header
curl -X POST https://sui-loyalty-api.mojito.xyz \
-H "authorization: Bearer JWT TOKEN" \
-H "Content-Type: application/json" \
Unique ID Login-Based Integration
Mojito supports a unique id based user login for easy integration. This approach uses the jwt issuer to validate users and allow them to be a part of the system using existing integrations.
🔧 Integration Steps
- Set Up JWT issuer domain
Update the admin portal with your jwt issuer:- Login to admin portal and head to organisation settings.
- Fill the jwt domain text-box with your jwt issuer.
- If you use any providers which doesn't provide with public jwks. Please reach out to Mojito for support in integrating your system.
- Users sub will be considered as their unique ID.
- Access Secured Endpoints
Use the bearer token received from the jwt issuer to access our platform endpoints. Users will be created accounts based on their unique ID (sub) from the bearer token and allowed to access our API.
Updated about 1 month ago