mercredi 10 juin 2020

JWT Laravel 5.2 performance issue

I am working with a REST API made with Laravel 5.2 that uses JWT to protect access to endpoints

To implement JWT jwt-auth was used (tymondesigns/jwt-auth).

The problem I am having when using the validation of the generated token is that the API response time increases considerably, for all endpoints, mainly those of the GET type.

For example: Without using JWT I am having a response time of 2.24 seconds, while using token validation it responds in 7.09 seconds as I show in the following images.

1. Generation of the token with the user's credentials

2. Making request with token validation enabled

3. Making request without token validation

Next, I show how the JWT implementation was made.

1. Composer.json file

2. Creation of a middleware for the routes that you want to protect with JWT

3. In the User model the table associated to the model is placed (it is actually a view)

4. The view is used for the validation of credentials when generating the token

5. Using middleware to protect routes

It would be great if any of you had the same problem and could orient me



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/37nUoYD
via IFTTT

Aucun commentaire:

Enregistrer un commentaire