Skip to content

BaseMax/php-jwt-example

Repository files navigation

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

If you are interested you may be interested to read more:

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.

Asrez Team