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 952 forks source link

Column 'code_challenge' cannot be null #1063

Open lewmilburn opened 4 months ago

lewmilburn commented 4 months ago

Hi, I've followed the cookbook guide and am getting this error.

Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'code_challenge' cannot be null in /**/oauth2-server-php/src/OAuth2/Storage/Pdo.php:292 Stack trace: #0 /**/oauth2-server-php/src/OAuth2/Storage/Pdo.php(292): PDOStatement->execute() #1 [internal function]: OAuth2\Storage\Pdo->setAuthorizationCodeWithIdToken() #2 /**/oauth2-server-php/src/OAuth2/Storage/Pdo.php(254): call_user_func_array() #3 /**/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCode.php(59): OAuth2\Storage\Pdo->setAuthorizationCode() #4 /**/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCode.php(31): OAuth2\ResponseType\AuthorizationCode->createAuthorizationCode() #5 /**/oauth2-server-php/src/OAuth2/Controller/AuthorizeController.php(140): OAuth2\ResponseType\AuthorizationCode->getAuthorizeResponse() #6 /**/oauth2-server-php/src/OAuth2/Server.php(384): OAuth2\Controller\AuthorizeController->handleAuthorizeRequest() #7 /**/authorize.php(25): OAuth2\Server->handleAuthorizeRequest() #8 {main} thrown in /**/oauth2-server-php/src/OAuth2/Storage/Pdo.php on line 292
jubayerarefin commented 3 months ago

as a quick fix, I added the two missing columns: 'code_challenge' & 'code_challenge_method'.

Already mentioned in #1059