1

We're using a Lumen micro-service for managing our authentication logic (token provider) and using its tokens in another Laravel 5.8 app for authentication (token consumer). Both apps are connected to the same database.

It turned out tokens generated by provider service are not authorized in consumer app just in the first second after generation. Still, if we put a delay of around 1 second, they will be authorized. We also tested tokens in the provider project, and all generated tokens work well and get authorized with no delay.

  • Provider Passport Version: 10.1.3
  • Provider Lumen Version: 8.2.7
  • Provider PHP Version: 8.1
  • Consumer Passport Version: 7.5.1
  • Consumer Laravel Version: 5.8.38
  • Consumer PHP Version: 7.4
  • Database Driver & Version: Postgres
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
Mojtaba Hn
  • 457
  • 2
  • 10
  • Where are your tokens stored? Do you use any cache maybe? – Mtxz Oct 19 '21 at 17:18
  • @Mtxz they're stored in database (default passport store for tokens), and no, we have no caches! – Mojtaba Hn Oct 20 '21 at 05:25
  • May it be due to some postgre optimisations like this one ? https://stackoverflow.com/questions/24252455/how-disable-postgresql-cache-optimization This is just a personal intuition abour a kind of problematic we already had but I can be wrong – YannPl Oct 21 '21 at 09:40

0 Answers0