oauth2-server-php-docs
oauth2-server-php-docs copied to clipboard
client_id is needed when using an authorization_code
I don't know if it is a bug or a mistake into Cookbook (Step-By-Step Walkthrough), but when you call this one:
curl -u testclient:testpass http://localhost/token.php -d 'grant_type=authorization_code&code=YOUR_CODE'
It fails. I had to repeat the client_id and it worked.
I could not reproduce OP's issue.
- Ran authorized.php in browser gave me back a code
- used code in
curl -u testclient:testpass http://walkthrough.local/token.php -d 'grant_type=authorization_code&code=[CODE]'
- gave me back a token.
How many clients into your db?
only 1... I was testing it out, haven't used in in more than one scenario now... I'll test out more clients.
Is this still an issue?
Yes I'm very curious if this was resolved. It could be the apache headers issue (documented here).
Could it be that you have the OAuth2\OpenID\GrantType\AuthorizationCode
grant type instead of OAuth2\GrantType\AuthorizationCode
?