Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Passport token length

Using passport for api authentication for a mobile app. The app devs were quick to complain about the size of the access_token provided (1071 characters) and having to pass it in each request.

On investigation the bulk of the token is the signature portion. By default passport is generating a 4096bit rsa key. I found i can reduce the token size to 559 characters by generating a 1024bit key instead. Better, but still much larger than keys generated by other services like Facebook.

I can not find much info on the subject, Is it a moot point? Is 1KB token nothing to complain about? Is reducing the key size a bad idea? Anything else that can be done to reduce the size?

Update: We have decided to continue without any changes to the key size.

like image 892
Vince Lowe Avatar asked Apr 26 '17 16:04

Vince Lowe


1 Answers

try this for shorter access token:

php artisan  passport:keys  --length=512 --force
like image 69
Mahfuz-ur Rahman Avatar answered Oct 22 '22 15:10

Mahfuz-ur Rahman