I am trying to connect to an oauth2 system using guzzle but I keep getting this message:
$guzzle = new GuzzleHttp\Client;
$response = $guzzle->post('https://logincert.anaf.ro/anaf-oauth2/v1/authorize', [
'form_params' => [
'grant_type' => 'authorization_code',
'response_type' => 'token',
'client_id' => 'xxxx',
'client_secret' => 'xxxxx',
'redirect_uri' => 'http://redirect'
],
]);
return json_decode((string) $response->getBody(), true)['access_token'];
{
"error":"invalid_client",
"error_description":"The client app does not support implicit grant"
}
The provider doesn't provide much information about the returned message, the only information that they provide are:
- Type: OAuth 2.0
- Add Authorization Data to: Request Headers
- Grant Type: Authorization Code
- Callback URL: http://redirect
- Authorization Endpoint: https://logincert.anaf.ro/anaf-oauth2/v1/authorize
- Token Endpoint: https://logincert.anaf.ro/anaf-oauth2/v1/token
- Token Revocation Endpoint: https://logincert.anaf.ro/anaf-oauth2/v1/revoke
- Client ID: xxx
- Client Secret: xxx
- Client Authentication type: Send as Basic Auth header
Any ideas what am I doing wrong?
Thanks, Chris