Amadis
Administration APIs - Authentication
Authentication (obtaining an OAuth 2.0 access token)
Every administration REST API call must embed a valid access token returned by this API:
Verb | POST |
Resource | /oauth/token |
Content type | application/x-www-form-urlencoded |
Body | grant_type=password& client_id=1& client_secret=<secret>& username=<name>& password=<password> |
Where:
Field | Description |
grant_type | Grant type is “password”, username and password are passed as argument to this request. |
client_id | Administrator’s client Id (string) |
client_secret | Administrator’s OAuth 2.0 secret (SAM backend configuration). |
username | Administrator’s username (SAM backend configuration). |
Password | Administrator’s password (SAM backend configuration). |
The response data is a JSON object with the following structure:
{ | Field | Description |
| “token_type”: ”Bearer”, | Always bearer |
| “expires_in”: <time (s)>, | Access token validity period (s) |
“access_token”: “<access token>” | Access token to be used in subsequent administration requests. | |
| “refresh_token”: “<refresh token>” | Refresh token |
} |
|
|