Authentication¶
Documentation regarding the authentication on Gigas.
Data resource¶
Token:
Field |
Explanation |
---|---|
access_token |
unique identifier |
expires_in |
token expiration in seconds |
refresh_expires_in |
refresh token expiration in seconds |
refresh_token |
unique refresh identifier |
token_type |
token type. always Bearer |
Revoke Token¶
- Method
POST
- Url
/auth/api/openid-connect/revoke
- Success Code
200
- Returned Data
None
Used for revoking access tokens. This endpoint allows authorized users to invalidate or revoke an access token. This can be useful in situations where there is a need to log out an user
Mandatory parameters
token: <token to be revoked>
Curl example¶
curl --location --request POST 'https://gigas.com/auth/api/openid-connect/revoke' \
--header 'Authorization: Bearer <authorization_token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'token=<token to be revoked>'
Note
To fully perform a logout you need to revoke all tokens from a user.
Get Token with 2FA Disabled¶
- Method
POST
- Url
/auth/api/openid-connect/token
- Success Code
200
- Returned Data
Used to request an access token, which is a crucial component of user authentication. Upon successful authentication, the server generates and returns an access token that allows the user to work within the system
Mandatory parameters
grant_type: password.
client_id: external
username: <user email>
password: <user password>
Curl example¶
curl --location --request POST 'https://gigas.com/auth/api/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data 'grant_type=password&client_id=external&username=my@email.com&password=mypass'
Get Token with 2FA Enabled¶
- Method
POST
- Url
/auth/api/openid-connect/token
- Success Code
200
- Returned Data
Same as the previous call, but having 2FA Enabled requires the temporary code (totp) to be sent for a successful authentication.
Mandatory parameters
grant_type: password.
client_id: external
username: <user email>
password: <user password>
totp: <temporary code provided by the device>
Curl example¶
curl -X POST 'https://gigas.com/auth/api/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data 'grant_type=password&client_id=external' \
--data 'username=my@email.com&password=mypass&totp=123456'
Note
Authentication mechanisms may change as security administrator requires.
Refresh Token¶
- Method
POST
- Url
/auth/api/openid-connect/token
- Success Code
200
- Returned Data
Refresh an expired or expiring access token using the refresh_token.
Mandatory parameters
grant_type: refresh_token.
client_id: external
refresh_token: <specific token used for refresh>
Curl example¶
curl -X POST 'https://gigas.com/auth/api/openid-connect/token' \
--header 'Authorization: Bearer <authorization token>' \
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data 'grant_type=refresh_token&client_id=external' \
--data 'refresh_token=<refresh token>'