BaseMax / php-jwt-example
PHP JWT example.
README
php-jwt-example
This is an example of how to decode PWT generated tokens and encode tokens in PHP. (Also jwt bearer token)
Installation
Use composer to manage your dependencies and download PHP-JWT:
composer require firebase/php-jwt
Usage Instructions
- Install the dependencies with Composer
- Run Encode:
$ php encode.php - Run Decode:
$ php decode.php
What's JWT?
JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties.
The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted.
Related pages
- https://jwt.io/
- https://github.com/firebase/php-jwt
- https://github.com/cdoco/php-jwt
- https://tools.ietf.org/html/rfc7519
If you are interested you may be interested to read more:
- https://github.com/nov/jose-php
- https://github.com/Spomky-Labs/jose
- https://www.example-code.com/phpExt/jwe.asp
Acknowledgment
I prepared this sample for Mr. Kambiz. I hope it helps you too.
Thanks to him for making me write this code.
Max Base
My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)
Asrez Team
A team includes some programmer, developer, designer, researcher(s) especially Max Base.
KiloClaw - Managed 🦀 