bshaffer / oauth2-server-php-docs

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

Use use_jwt_access_tokens with Pdo storage #110

Open SventB opened 6 years ago

SventB commented 6 years ago

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?

iqbalfn commented 6 years ago

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.

zamalex41 commented 5 years ago

thru txt yes

rlvillacarlos commented 5 years ago

I think this must be reflected in the docs.