Get Access Token Information
Endpoint que toma el access token dado y entrega la información asociada a ella que se encuentra en el servicio. Se puede encontrar información como el dueño del recursos, los scopes, la fecha de expiración, entre otra información relevante. Dicho access token es tomado desde el header de autenticación y debe ser del tipo Bearer Token.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Authorization | Bearer {{access_token}} | access_token obtained in Atenea |
Method: GET
URL: https://atenea.trust.lat/oauth/token/info
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Code Examples
- Curl
- JavaScript
- Python
curl --location --request GET 'https://atenea.trust.lat/oauth/token/info' \
--header 'Authorization: Bearer *********'
import requests
url = "https://atenea.trust.lat/oauth/token/info"
payload={}
headers = {
'Authorization': 'Bearer *********'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var config = {
method: 'get',
url: 'https://atenea.trust.lat/oauth/token/info',
headers: {
'Authorization': 'Bearer *********'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Responses
HTTP Code: 200 OK
Token information retrieved
{
"resource_owner_id": 999,
"scope": [
"event.service_log.w",
"event.service_log.r",
"event.events.w",
"event.events.r",
"channel.channel.w",
"channel.channel.r",
"channel.channel.list",
"channel.messages.r",
"channel.messages.status.w",
"channel.trust_feed.w",
"channel.trust_feed.r",
"company.app.w",
"atenea.user.w",
"atenea.users.r.all",
"atenea.role.a.*",
"atenea.role.a.enrollment_admin",
"company.list_flavors.r",
"index.device.w",
"index.device.r",
"index.tags.r",
"index.tags.w",
"index.list_models",
"index.app_versions",
"persistence.segment.r",
"persistence.segment.w"
],
"expires_in": 7177,
"application": {
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"company_uid": "99"
},
"created_at": 1626884149,
"company_uid": "99"
}
HTTP Code: 401 Unauthorized
Invalid Access Token
{
"error": "invalid_token",
"error_description": "The access token is invalid",
"state": "unauthorized"
}