bshaffer / oauth2-server-php

A library for implementing an OAuth2 Server in php
http://bshaffer.github.io/oauth2-server-php-docs
MIT License
3.26k stars 950 forks source link

Authorization Storage Issue #956

Open JavedBoqo opened 5 years ago

JavedBoqo commented 5 years ago

Hi, An authorization code is not being store in oauth_authorization_codes table in db while I am getting authorization code in $response object. In authorize.php page when I comment the line

$response->send();

then authorization code is storing in database. Am I missing something here? Below is my authorization testing URL http://localhost/my-code/authorize.php?response_type=code&client_id=1&state=100&user_id=100

bodnarlajostibor commented 5 years ago

I'm using the token but cannot store the user_id to token also. Can someone please help us how to?

I got one api call to send back a new token. Should I insert the handleAuthorizeRequest(OAuth2\Request::createFromGlobals(), $response, true, $userid); also? Or in a separate next request?

$token = $OAuth2Server->getAccessTokenData($request); is alway returning null to me and ofc the user_id is not in the database (oauth_access_tokens table).

yuranikspb commented 4 years ago

i have save to db trouble too,Authorization code not save to db

adisazhar123 commented 4 years ago

Auth codes are deleted once you trade it for an access token