Laravel Passport Token Length

Using a passport for api authentication for a mobile application. Application developers quickly complained about the size of the provided access_token (1071 characters) and had to pass it on every request.

During the investigation, the main part of the token is part of the signature. By default, the passport generates a 4096-bit rsa key. I found that I can reduce the size of the token to 559 characters by creating a 1024-bit key instead. Better, but still much more than keys created by other services such as Facebook.

I can not find a lot of information on this issue, is this a moot point? Is the 1K token nothing to complain about? Does key size reduce a bad idea? What else can be done to reduce the size?

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

+5
source share
2 answers

try this for a shorter access token:

php artisan  passport:keys  --length=512 --force
0
source

559 characters, generating a 1024-bit key

the minimum number of characters you could get should be 1024/8 (bits per character) = 128

I usually don’t work on the cloud, but only from the point of view of C, I wonder how you got 559 characters. I assume that you encode characters into a URL, which can increase the number of characters, as you need to avoid some?

, " ", , http/https, access_token 128.

, , api , .

0

Source: https://habr.com/ru/post/1675728/


All Articles