Access Token for GM-API Server

🔐 Steps to Generate Access Token for GM-API-Server

🧾 Overview

To invoke APIs on the GM-API-Server (e.g., user onboarding, IDV token generation), an OAuth2 access token is required. This section outlines the steps to generate that token using client credentials grant type.

Access token generation requires registration on the GM Portal and the use of REL-ID AuthServer.


📝 Step 1: Register Enterprise in GM Portal

Login to the GM Portal and perform the following:

  1. Go to Enterprise Management.

  2. Create a new enterprise.

  3. Configure the following:

    • Authentication TypeOAuth2
    • Resource IDsGM API Server
    • Access Token Validity3600 (in seconds, i.e., 1 hour) or as needed
    • Enable Refresh Tokentrue/false (as per requirement)
  4. After registration:

    • ✅ Download your Client ID and Client Secret

📌 If you don’t have portal access, ask the REL-ID admin to provide the credentials.


🔐 Step 2: Call AuthServer API to Generate Token

The AuthServer uses Basic Auth to issue tokens. Your client ID is the username, and the client secret is the password.

📘 Token Endpoint

POST https://<AUTH-SERVER-IP>:8006/relid/authserver/oauth/token?grant_type=client_credentials&scope=all

🔐 Headers

Authorization: Basic Base64(client_id:client_secret)
Content-Type: application/x-www-form-urlencoded

✅ Sample cURL Request

curl -X POST "https://<AUTH-SERVER-IP>:8006/relid/authserver/oauth/token?grant_type=client_credentials&scope=all" \
  -H "Authorization: Basic <base64(client_id:client_secret)>" \
  -H "Content-Type: application/x-www-form-urlencoded"

📦 Sample Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "expires_in": 3600,
  "scope": "all"
}

🔐 Security Note

  • Ensure the IP address of the calling service is whitelisted by the REL-ID admin.
  • Protect the client credentials and never expose them in frontend apps.
  • Rotate credentials periodically for enhanced security.

🧪 Use Access Token

Use the retrieved token in the Authorization header when calling GM APIs:

Authorization: Bearer <access_token>

✅ Completion

After completing this step, your service is ready to make authenticated calls to the GM-API-Server.