oauth2-server-php-docs icon indicating copy to clipboard operation
oauth2-server-php-docs copied to clipboard

Use use_jwt_access_tokens with Pdo storage

Open SventB opened this issue 7 years ago • 3 comments
trafficstars

When I use Pdo Storage together with option "use_jwt_access_tokens", the generated access tokens are very long but the database field "access_token" in table "oauth_access_tokens" can handle just 40 characters (see https://bshaffer.github.io/oauth2-server-php-docs/cookbook/).

$storage = new OAuth2\Storage\Pdo($pdo);
$server = new \OAuth2\Server($storage, [
  'use_jwt_access_tokens' => true,
]);

Did I configure something wrong? Or do I have to change field "access_tokens" to type "text" and remove the primary key?

SventB avatar Feb 22 '18 15:02 SventB

That's actually normal, the access_token is now provided as JWT. You could change the table column type to text ( but primary key maybe a problem under MySQL, or no? ), or set store_encrypted_token_string option to false to save only un-encrypted access_token.

iqbalfn avatar Mar 23 '18 15:03 iqbalfn

thru txt yes

zamalex41 avatar Sep 14 '18 23:09 zamalex41

I think this must be reflected in the docs.

rlvillacarlos avatar Sep 16 '18 23:09 rlvillacarlos