this is the first layer of authentication which uses x-www-form-urlencoded with
grant_type -> client_credentials
client_id, client_secret
after that with access token I will can use to access the data from api.
But the problem is: every 4 hours the token expiry. How I can make a connection with form-urlencoded passing the info above in a way that persist and re-activate every 4 hours generating a token that can be accessed everywhere in my application.
Basically, how I can implement it? I searched through some docs but I only found only with JWT. and not with two types of authentication.
Oh, I thought you were asking how to handle the two different pieces. Thereâs nothing for âconnecting to an APIâ, but there is the HTTP library, or you can use cURL, either of which let you create requests to send to other servers.
Thanks again.
Can you tell me about this http library?(any doc or example of the connection through xx-form-urlencoded I have done api connection with node js, but I never did with cake php,
In curl I can do the same thing right?
â>Curl -> formurlencoded -> Save token to session for 3 hours if session token does not exist. then another curl to connect to the server with the access token
I didnt saw explicity on documentation but if the server return access token
I should get the response header âaccess tokenâ by doing this exactly ?
$response->getHeader(âaccess_tokenâ);
im passing the body as this
âbodyâ => [âgrant_typeâ => âclient_credentialsâ, âclient_idâ => âfasfafsâ, âclient_secretâ => âaffsaatestâ],
but iâm getting error, this is the correct way to pass multiple values into the body on http client post ?