bshaffer / oauth2-server-php-docs

documentation for the oauth2-server-php library
231 stars 148 forks source link

client_id is needed when using an authorization_code #96

Open bbalet opened 7 years ago

bbalet commented 7 years ago

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.

alpha1125 commented 7 years ago

I could not reproduce OP's issue.

  1. Ran authorized.php in browser gave me back a code
  2. used code in
    curl -u testclient:testpass http://walkthrough.local/token.php -d 'grant_type=authorization_code&code=[CODE]'
  3. gave me back a token.
bbalet commented 7 years ago

How many clients into your db?

alpha1125 commented 7 years ago

only 1... I was testing it out, haven't used in in more than one scenario now... I'll test out more clients.

bluebaroncanada commented 7 years ago

Is this still an issue?

bshaffer commented 6 years ago

Yes I'm very curious if this was resolved. It could be the apache headers issue (documented here).

ghost commented 6 years ago

Could it be that you have the OAuth2\OpenID\GrantType\AuthorizationCode grant type instead of OAuth2\GrantType\AuthorizationCode?