Menu

JWT
Introduction to JWT

Preface

What is a JSON Web Token?

According to the JWT site, JSON Web Token (JWT) is an open standard (RFC 7519 ) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA.

Leaf comes along with a JWT object that comes with all JWT's functionality. Although you can use this directly, Leaf Core comes with a better alternative which makes working with JWT even simpler: Leaf Core's Simple Authentication

Using the JWT object

Intro

To use JWT, you must import it just like all other modules.

$jwt =new Leaf\Helpers\JWT();
More info here

Simple Authentication

To use Simple Authentication, you must import it just like all other modules.

$authentication =new Leaf\Core\Authentication();
View the simple auth docs

Next Steps

Re-routing to index.php
Simple Routing
Request
Response