FriendsOfSymfony / FOSOAuthServerBundle

A server side OAuth2 Bundle for Symfony
1.09k stars 450 forks source link

Problem with second client #632

Open jllaurado opened 4 years ago

jllaurado commented 4 years ago

I'm having an issue with the deployment of the server and I'm stuck trying to solve it.

I have configured a server with no problems, and I have configured also a client without problem either, but when I add a second client, the authentication process fails in an unusual way, at the end of the process when the client calls the resource owner to get the detail credentials.

Adding a try/catch there I found out that the answer received from the server was an SQL error (on the server side there was no error on symfony log). The error is that the bundle tries to make a second insert in the access_token table when already there is one... Can anyone help me find why is happening that on the bundle?

`string(415) "An exception occurred while executing 'INSERT INTO access_token (token, expires_at, scope, user_id) VALUES (?, ?, ?, ?)' with params ["MDRjMmMxMmUyOWQ2Zjg0ZjE5YmU2MmQyMTdhNTg4ZTNmNDQyNDIxNDkzMDFjMTdkYWMzM2FlM2E1YTBjYWFiZg", 1573109877, null, 1]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'MDRjMmMxMmUyOWQ2Zjg0ZjE5YmU2MmQyMTdhNTg4ZTNmNDQyNDIxNDkzMDFjMTdk' for key 'UNIQ_B6A2DD685F37A13B'" string(4408) "#0 /home/darlock/public_html/FinMgr1/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(636): App\Security\BBSOauthGenericProvider->checkResponse(Object(GuzzleHttp\Psr7\Response), Array)

1 /home/darlock/public_html/FinMgr1/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(538): League\OAuth2\Client\Provider\AbstractProvider->getParsedResponse(Object(GuzzleHttp\Psr7\Request))

`

I'm using: friendsofsymfony/oauth-server-bundle 1.6.2

and on the client side: knpuniversity/oauth2-client-bundle v1.30.0