Service Accounts
Regular users normally create accounts with user roles assigned in the application.
Developers can also create the so-called service accounts in order to perform some service functions, like testing. When you create a service account,the system generates a certain user token for this service account.
A service account is a special type of user account that external applications or services can utilize to manage resources within the project. Such a user cannot log in to the system with e-mail and password, but it has a UID and a system-generated token assigned to the service account. You can assign roles for such accounts, just as you do for regular users.
A developer can give to the service account permissions to perform certain functions in the project. A developer can use the service account token and UID to launch sessions on behalf of the service account with the assigned permission.
Create Service Account
Click the Create service account button to create a new one.
When you create a new service account, you can specify a display name, comment, limit token lifetime, access by IP address and public key.
As a result of creating a service account, you will be issued a token that will allow you to make API requests on behalf of the account.
Warning
For your protection, you should never share your token with anyone. If you have lost your token or it has been compromised, you can generate a new token for the account.
Generate New Token for Existing Service Account
If you need to generate a new token for an existing service account (e.g. in case your current token has been compromised), click Generate New Token. In the dialog box that opens, you can specify the lifetime of the new token.
Manage Service Accounts
Get Service Accounts
POST /proxy/api/gc/serviceAccount/get
Description
Retrieves the list of service accounts associated with the certain project.
Request
{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", // User authentication JWT token. Type: string
"factor": "email", // Optional second-factor user identifier (used instead of service_jwt). Type: string
"service_jwt": "...", // JWT of the service (used instead of factor). Type: string
"project_id": "abc123" // Project identifier. Type: string
}
Response
{
"status": "OK|ERROR", // Response status. Type: string
"users": [ // List of user objects
{
"login": "service_warthunder1", // User login name. Type: string
"user_id": "134180918", // Unique user identifier. Type: string
"display_name": "Player123", // Custom display name. Type: string
"comment": "Test user account" // Custom description. Optional. Type: string
}
],
"error": "error string" // Error message (if status is "ERROR"). Type: string
}
Create Service Account
POST /proxy/api/gc/serviceAccount/add
Description
Creates a new service account for the certain project.
Request
{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", // User authentication JWT token. Type: string
"factor": "email", // Optional second-factor user identifier (used instead of service_jwt). Type: string
"service_jwt": "...", // JWT of the service (used instead of factor). Type: string
"project_id": "abc123", // Project ID. Type: string
"jwt_ttl": 3600, // TTL in seconds. Optional. Type: integer
"display_name": "Player123", // Custom display name. Optional. Type: string
"comment": "Test user account" // Custom description. Optional. Type: string
}
Response
{
"status": "OK|ERROR", // Response status. Type: string
"gjnick": "Player123", // Type: string
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", // User authentication JWT token. Type: string
"jwt_expired": 1700000000, // JWT expiration timestamp. Type: integer (Unix epoch format)
"lang": "en", // Type: string
"level": "normal", // Type: string
"login": "user_login", // Type: string
"nick": "UserNickname", // Type: string
"reg_time": "2024-02-11T12:34:56Z", // ISO 8601 format recommended. Type: string
"tags": "premium, beta_tester", // Type: string
"user_id": "123456789", // Type: string
"error": "error string" // Error message (if status is "ERROR"). Type: string
}
Remove Service Account
POST /proxy/api/gc/serviceAccount/remove
Description
Deletes the service account associated with the certain project.
Request
{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", // User authentication JWT token. Type: string
"factor": "email", // Optional second-factor user identifier (used instead of service_jwt). Type: string
"service_jwt": "...", // JWT of the service (used instead of factor). Type: string
"project_id": "abc123", // Project identifier. Type: string
"user_id": 123456789 // Unique user identifier. Type: string or integer
}
Response
{
"status": "OK|ERROR", // Response status. Type: string
"...": "...", // User data fields
"error": "error string" // Error message if applicable. Type: string
}
Generate Service Account Token
POST /proxy/api/gc/serviceAccount/generateToken
Description
Generates a new JWT token for an existing service account within a certain project.
Request
{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", // User authentication JWT token. Type: string
"factor": "email", // Optional second-factor user identifier (used instead of service_jwt). Type: string
"service_jwt": "...", // JWT of the service (used instead of factor). Type: string
"project_id": "abc123", // Project ID. Type: string
"jwt_ttl": 3600, // JWT expiration time in seconds. Optional. Type: integer
"jwt_public_key": "MIIBIjANBgkqh...", // Public key for JWT verification. Optional. Type: string
"fixed_ips": [ // List of fixed IP addresses. Optional
{
"192.168.1.1", // ip0. Type: string
"203.0.113.42" // ipN. Type: string
}
]
}
Response
{
"status": "OK|ERROR", // Response status. Type: string
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", // User authentication JWT token. Type: string
"jwt_expired": 1700000000, // JWT expiration timestamp. Type: integer (Unix epoch format)
"error": "error string" // Error message (if status is "ERROR"). Type: string
}
Revoke Service Account Token
POST /proxy/api/gc/serviceAccount/revokeTokens
Description
Revokes previously issued JWT token for a service account by incrementing the token revision number.
This method increases the current token revision for the specified user, thereby invalidating all previously issued token.
Request
{
"jwt": "...", // User authentication JWT token. Type: string
"factor": "...", // Optional second-factor identifier (used instead of service_jwt). Type: string
"service_jwt": "...", // JWT of the service (used instead of factor). Type: string
"project_id": "...", // Project ID. Type: string
"user_id": "..." // ID of the user whose tokens should be revoked. Type: string or integer
}
Response
{
"status": "OK|ERROR", // Response status. Type: string
"revision": 45, // New token revision value for the user. Type: integer
"error": "error string" // Error message (if status is "ERROR"). Type: string
}