hi all,
Is there someone who have worked with Akeneo PIM ?
i don’t know how to deal with their credentials token / refresh
https://api.akeneo.com/documentation/authentication.html#refresh-an-expired-token
Cani deal with this with oauth2 credential or am i obliged to catch the expired token in all the workflow.
thanks
The HTTP node will refresh the token automatically for you. @Chris_Doudet
Hi @RicardoE105,
I cant’ use oauth2 credential because the authentification wait for a post.
From the documentation :
curl -X POST http://my-favorite-pim.com/api/oauth/v1/token \
-H "Content-Type: application/json" \
-H "Authorization: Basic NGdtNHJub2l6cDhnc2tna2swODBzc29vODAwNDBnNDRrc293d2d3ODQ0azQ0c2MwMHM6NWR5dm8xejZ5MzRzbzRvZ2tna3N3ODhvb2tvb3dzMDBjZ29jNDg4a2NzOHdrNGM0MHM=" \
-d '{
"grant_type": "password",
"username": "myERPuser",
"password": "64bngr78"
}'
Response
HTTP/1.1 200 OK
{
"access_token": "NzFiYTM4ZTEwMjcwZTcyZWIzZTA0NmY3NjE3MTIyMjM1Y2NlMmNlNWEyMTAzY2UzYmY0YWIxYmUzNTkyMDcyNQ",
"expires_in": 3600,
"token_type": "bearer",
"scope": null,
"refresh_token": "MDk2ZmIwODBkYmE3YjNjZWQ4ZTk2NTk2N2JmNjkyZDQ4NzA3YzhiZDQzMjJjODI5MmQ4ZmYxZjlkZmU1ZDNkMQ"
}
If i try from oauth credential, i get this:
{“code”:405,“message”:“No route found for "GET /api/oauth/v1/token": Method Not Allowed (Allow: POST)”}
So the http node will not be managed by a credential method.
For what i undestand i am obliged to use a http node to get the token wich i can use in the workflow.
And in this case i am obliged to manage the token expiration.
Is it possible to use another credential type to manage this ? Using a token generate by a first workflow that put some variable somewhere ?
thanks
Ahhh, now I get it. Yes, the OAuth2 authentication method sadly uses POST to exchange the token. This is the first time I see something different than a POST to do that. As you mentioned, you will need to use a couple of HTTP nodes and store the refresh token somewhere. Maybe in the workflow’s static data.
Ok thank you
A Google request on “oauth2 request post” return many lines.
May be an update for oauth2 credential with a post ? 