oauth2-server-php-docs
oauth2-server-php-docs copied to clipboard
Use use_jwt_access_tokens with Pdo storage
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?
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.
thru txt yes
I think this must be reflected in the docs.