Authentication
GAINSConnect supports two methods of authentication:
- Basic authentication: username and password has to be defined in GAINS User Management (this can be done by an existing admin or a GAINS admin)
- oAuth2.0: as of August 2025, we also support access via oAuth 2.0. Please contact GAINS rep if you would like to get set up with your access token
oAuth Authentication
Please note the server URL's for oAuth token generation:
- Production: https://auth.gainsapps.com
- Development: https://auth-dev.gainsapps.com
These servers are used only for token generation and are the same for all clients — they are not your GAINSConnect environment.
Requesting a token
Send a POST to /realms/GAINSystems/protocol/openid-connect/token on the server above, with an application/x-www-form-urlencoded body. GAINSystems is the realm that issues tokens for the GAINSConnect API:
| Field | Required | Value |
|---|---|---|
grant_type | Yes | client_credentials |
client_id | Yes | The client identifier you were issued |
client_secret | Yes | The secret you were issued |
curl -X POST https://auth.gainsapps.com/realms/GAINSystems/protocol/openid-connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=<your client id>" \
-d "client_secret=<your client secret>"The response
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJqTl9F...",
"expires_in": 600,
"refresh_expires_in": 0,
"token_type": "Bearer",
"not-before-policy": 0,
"scope": "email profile"
}| Field | Meaning |
|---|---|
access_token | The JWT to present to GAINSConnect |
expires_in | Seconds the token remains valid — 600, i.e. 10 minutes |
refresh_expires_in | 0: no refresh token is issued |
token_type | Always Bearer |
Using the token
Send the returned access_token on every GAINSConnect request:
curl https://<your-environment>.gainsystems.com/api/v1/customers \
-H "Authorization: Bearer <access_token>"Updated 6 days ago
Did this page help you?
