What library should I use for parsing and validating JWT token in PHP?

No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.

Could anyone please suggest what PHP library should I use for parsing and validation of JWT / OIDC token?

At this moment I have found this library by firebase however I am not sure how stable and reliable it is.

If you know any other proven / better library for PHP / JWT, please suggest it here!


1 Answer

Internet users could send Bitcoin Tips to you if they like your answer!

I would suggest you to read this JWT article for starters. They explain basics about JWT token structure.

Here is what I think about "firebase/php-jwt" library:

  1. It is not that much code in their JWT.php file so it would not be too difficult to get yourself familiar with that code (after you read the article above). It follows the common steps required to validate JWT regardless of programming language i.e. PHP or Java or Ruby or Python or Perl - the validation / parsing logic would be very similar
  2. I use that library and it works quite stable
  3. Unfortunately I cannot suggest you any alternative PHP JWT library

Too many commands? Learning new syntax?

FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.

Boost your productivity with FavScripts.com!

Post Answer