Integration path
Integration Guide: E-Wallet SSO
This guide describes how to integrate the Innovorder E-Wallet (e-rechargement) interface into an external guest application (e.g., via a WebView) using a Single Sign-On (SSO) mechanism.
Prerequisites
- Brand ID: Unique identifier for your brand.
- JWT Secret: A private key shared between your backend and Innovorder.
1. Generate the JWT
First, your backend must generate a signed JWT containing the user's identity. This token serves as a proof of authentication.
Payload Structure
{
"email": "user@example.com",
"brandId": 12345,
"date": "2023-10-27T10:00:00.000Z" // ISO 8601 String
}Example (Node.js)
const jwt = require('jsonwebtoken');
const payload = {
email: "user@example.com",
brandId: 691,
date: new Date().toISOString()
};
const jwtSecret = "YOUR_SHARED_SECRET_KEY";
const signedJwt = jwt.sign(payload, jwtSecret);
console.log(signedJwt);
// Output: eyJhbGciOiJIUzI1NiIsIn...2. Exchange for Access Token
Unlike the Web Ordering SSO, the E-Wallet requires a valid API accessToken to perform the auto-login. You must exchange your signed JWT for an Innovorder accessToken via the API.
POST/oauth/loginExchange JWT
Send the generated JWT to receive an accessToken. The access token is valid for 24 hours; when it expires the API responds with a 401 error (token_expired) and you must exchange a fresh JWT again.
Request Body
{
"autoLoginJWT": "eyJhbGciOiJIUzI1NiIsIn..."
}Request Body Properties
Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.
| Property | Type | Example | Description |
|---|---|---|---|
| autoLoginJWT | string | "eyJhbGciOiJIUzI1NiIsIn..." | The auto login jwt value. |
Response
{
"access_token": "VALID_ACCESS_TOKEN_XYZ...",
"token_type": "Bearer"
}Response Properties
Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.
| Property | Type | Example | Description |
|---|---|---|---|
| access_token | string | "VALID_ACCESS_TOKEN_XYZ..." | The access token value. |
| token_type | string | "Bearer" | The token type value. |
3. Redirect the User
Construct the final URL by appending the received accessToken to the autoLoginByAccessToken query parameter. Open this URL in your WebView or iframe.