Skip to main content

Login

  • Obtain API Key and Secret (provided by us)
  • Save API secret and key securely in client
  • Client generates a signed request using the Secret
  • Authentication service validates the signature and issues a JWT token
  • Client uses the JWT token for subsequent API calls
  • Response now include all player configs

Auth End Point

POST https://api.gameramp.com/auth/login

Request Body

{
  "apiKey": "<api_key>", // API Key
  "deviceId": "<unique_device_identifier>", // Unique device id(from client)
  "timestamp": "2025-07-15T19:43:41Z", // Current UTC timestamp in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ)
  "signature": "<signature>" // HMAC-SHA256 signature encoded in Base64
}

Generating signature

The signature is generated using HMAC-SHA256 with API Secret. The payload to sign is a pipe-delimited string of three values:
apiKey|deviceId|timestamp
e.g - test_tenant_4Dqms3ygG9FVC|device-123|2025-07-15T19:43:41Z The resulting HMAC-SHA256 digest must be Base64-encoded to create the signature.

Security Requirements

  • API Secret and key should be saved securely in client
  • Timestamps must be within 5 minutes of the server time

Response

Success

{
  "accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "tokenType": "Bearer",
  "expiresIn": 3600,
  "userId": "device-123_unique_id",
  "deviceId": "device-123",
  "gameId": "default_game",
  "tenantId": "test_tenant_1752523421",
  "playerConfig": {
    "playerStatus": {
      "isPayer": {
        "value": true,
        "defaultValue": false,
        "expiredAt": null
      }
    },
    "storeConfig": {
      "activeSkus": [
        {
          "skuId": "starter_pack",
          "name": "Starter Pack",
          "description": "Perfect for new players",
          "actualPrice": 0.99,
          "offerPrice": 0.99,
          "currency": "USD",
          "assets": [],
          "active": true
        },
        {
          "skuId": "remove_ads",
          "name": "Remove Ads",
          "description": "Removes all advertisements",
          "actualPrice": 2.99,
          "offerPrice": 2.99,
          "currency": "USD",
          "assets": [],
          "active": true
        },
        {
          "skuId": "premium_currency_small",
          "name": "Premium Currency (Small)",
          "description": "100 premium coins",
          "actualPrice": 4.99,
          "offerPrice": 4.99,
          "currency": "USD",
          "assets": [],
          "active": true
        }
      ],
      "lastUpdatedTimestamp": 0,
      "userSpecificPromoId": null,
      "fallbackConfig": null
    }
  }
}

Error

  • 401 Unauthorized
  • 400 Bad request (Request timestamp is outside the acceptable time window.)

Using auth token

After successful authentication, use the provided JWT access token in subsequent API requests by including it in the Authorization header:
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
The access token will expire after the duration specified in expiresIn (in seconds). Use the refresh token to obtain a new access token when needed.

Dev Keys

  • API Key - test_tenant_4Dqms3ygG9FVC
  • API Secret - b815ebac-9744-43db-b5e6-89f90620297e-Wjl8qlWrJn2r4OEB7UXJ_L8iYOLTR8p10t83Wi_79Q

Example

curl -X POST 'https://api.gameramp.com/auth/login' \
  -H 'Content-Type: application/json' \
  -d '{"apiKey": "test_tenant_4Dqms3ygG9FVC", "deviceId": "device-123", "timestamp": "2025-07-15T19:44:26Z", "signature": "/Sn9msNKK4ifTEYrGC/GKpRptolLIyWi4jsfdn5S4g8="}'
Response:
{
  "accessToken": "eyJraWQiOiI1Zjk5ZmRjMy1hMTdlLTg3ZGYtOWI4YS1jM2VmN2Y3M2FiMmQiLCJhbGciOiJSUzI1NiJ9.eyJ0ZW5hbnRfaWQiOiJ0ZXN0X3RlbmFudF8xNzUyNTIzNDIxIiwiZGV2aWNlX2lkIjoidGVzdC1kZXZpY2UtNDU2IiwiZ2FtZV9pZCI6ImRlZmF1bHRfZ2FtZSIsInN1YiI6InRlc3QtZGV2aWNlLTQ1Nl8yMGY2Y2FiMiIsImlhdCI6MTc1NDQ4NTYyNSwiZXhwIjoxNzU0NDg2NTI1fQ.LcKpK5AGpJoxbZn2iPOBDx-IGcOTL6odTPUjXo_YW1rHZJYR2Mf42MjMDJO98Paq0d6AFHAIpTSjtzOp6Ih8qrMsfngmB0a_W3sNVEL4XBTw0rLDK7YSFOqD6MKlGQq9VPPO0kOWSYLgTuTAkzSVTuVMiqWjBsxuQOb-KknhVrDgMy6bVaHeK8fcqQP36iHW6Xy47dleEf60z7cLmBT4MRjb7cy3RUcDuOvN5c9LfVmSCjBALLG7MSJZbvAUv3JO5mit6soCQOnxl_klkoRO75aor5w9MAAhjRFD1sdJRRMC-feDxXzFOgeP_CMjPNvBfGl02MdVuLAsu8wqiBmCZA",
  "refreshToken": "2b78c91e-5e14-4d75-a558-a45880d03233",
  "tokenType": "Bearer",
  "expiresIn": 900000,
  "userId": "test-device-456_20f6cab2",
  "deviceId": "device-123",
  "gameId": "default_game",
  "tenantId": "test_tenant_1752523421",
  "playerConfig": {
    "playerStatus": {
      "isPayer": {
        "value": true,
        "defaultValue": false,
        "expiredAt": null
      }
    },
    "storeConfig": {
      "activeSkus": [
        {
          "skuId": "starter_pack",
          "name": "Starter Pack",
          "description": "Perfect for new players",
          "actualPrice": 0.99,
          "offerPrice": 0.99,
          "currency": "USD",
          "assets": [],
          "active": true
        },
        {
          "skuId": "remove_ads",
          "name": "Remove Ads",
          "description": "Removes all advertisements",
          "actualPrice": 2.99,
          "offerPrice": 2.99,
          "currency": "USD",
          "assets": [],
          "active": true
        },
        {
          "skuId": "premium_currency_small",
          "name": "Premium Currency (Small)",
          "description": "100 premium coins",
          "actualPrice": 4.99,
          "offerPrice": 4.99,
          "currency": "USD",
          "assets": [],
          "active": true
        }
      ],
      "lastUpdatedTimestamp": 0,
      "userSpecificPromoId": null,
      "fallbackConfig": null
    }
  }
}