Skip to content

Self On-Boarding & Generating Auth Token#

Step 1: Signing up on Vayana Network#

Please follow the link shared below to create user and organization.

Link: How to sign-up on Vayana Network?

Note: save organisation-id for EAS integration.

Step 2: Implementing theodore API#

To integrate with EAS, client will have to first create an expiring auth-token for authentication. This auth-token is created by implementing ‘login’ API of the authentication server (theodore).

Environment#

Production#

Description URL
Base URL https://services.vayana.com/theodore/apis/v1
Health Check URL https://services.vayana.com/theodore/apis/health

Sandbox#

Description URL
Base URL https://sandbox.services.vayananet.com/theodore/apis/v1
Health Check URL https://sandbox.services.vayananet.com/theodore/apis/health

Base URL#

https://{domain}/theodore/apis/{version}

where, domain is based on the environment

Generate Auth Token#

Returns a JWT auth-token which can be used to make authenticated calls.

Token validity period (in minutes) can be specified using tokenDurationInMins in the request body, which is a non-mandatory param. Default token duration, if not specified, is 20 mins. Max duration restricted to 360 mins (6 hours). So if one specifies tokenDurationInMins = 370; the token will be created with expiry of 360 mins.

Hard expiry of the session, once a token is issued to the user, is set to 6x of the token duration. For example, if token duration is of 20 mins, hard expiry will be 120 mins (2 hours). If token duration is of 360 mins, hard expiry will be 2160 mins (36 hours).

After hard expiry, tokens cannot be refreshed. User will have to re-authenticate.

Max no of active sessions for a user is 10.

Route

/authtokens

  • active ‘version’: v1
  • method: POST

Request Body#

Example

{
  "handle": {user-email},
  "password": {user-password},
  "handleType": "email",
  "tokenDurationInMins": 360
}

Response Body#

Example

{
  "data": {
    "token": "...",
    "userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "expiry": 0,
    "email": "string",
    "mobile": "string",
    "givenName": "string",
    "lastName": "string",
    "state": "string",
    "verificationStatus": "None",
    "passwordLastModified": 0,
    "associatedOrgs": [
      {
        "organisation": {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "name": "string",
          "taxIdentifier": "string",
          "taxIdentifierType": "PAN",
          "country": "string",
          "services": [
            {
              "serviceCode": "string",
              "serviceName": "string"
            }
          ]
        },
        "userAccessInfo": {
          "primary": true,
          "admin": true
        }
      }
    ],
    "timezone": "string",
    "locale": "string",
    "createdOn": 0,
    "lastUpdated": 0
  }
}

Note: save data.token for EAS integration. Re-generate the token before data.expiry (epoch) expires.


Last update: May 19, 2022