Download the PHP package fachsimpeln/easyjwt without Composer
On this page you can find all versions of the php package fachsimpeln/easyjwt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fachsimpeln/easyjwt
More information about fachsimpeln/easyjwt
Files in fachsimpeln/easyjwt
Package easyjwt
Short Description A easy-to-use implementation of of JWT Standard (JSON Web Tokens)
License MIT
Homepage https://github.com/fachsimpeln/EasyJWT
Informations about the package easyjwt
EasyJWT
An easy-to-use implementation of of JWT Standard (JSON Web Tokens)
What is JWT?
JSON Web Token (JWT [...]) is an internet standard for creating JSON-based access tokens. [...] For example, a server could generate a token that has the claim "logged in as admin" and provide that to a client. The client could then use that token to prove that it is logged in as admin. The tokens can be signed by one party's private key (usually the server's) so that party can subsequently verify the token is legitimate. If the other party, by some suitable and trustworthy means, is in possession of the corresponding public key, they too are able to verify the token's legitimacy. The tokens are designed to be compact, URL-safe, and usable especially in a web-browser single-sign-on (SSO) context. JWT claims can typically be used to pass identity of authenticated users between an identity provider and a service provider, or any other type of claims as required by business processes.
~ taken from Wikipedia
Why EasyJWT?
EasyJWT is intended to provide a version of JWT that is particularly easy to implement. So far only the easy to understand symmetric signing methods are used.
The library also supports the symmetric encryption of the JWT token with AES (using openssl), if confidential or sensitive information is to be stored in JWT.
Install via Composer
Install without Composer
- Clone this repository
- Include ./lib/JWT.inc.php
Documentation
Usage documentation can be found in the Wiki. The documentation for the code can be found in docs/
Supported Algorithms
Signing Algorithm | What is this? |
---|---|
HS256 | HMAC-SHA256 |
HS384 | HMAC-SHA384 |
HS512 | HMAC-SHA512 |
none | not recommended |
Encryption Algorithm | What is this? |
---|---|
AES-256-GCM | OpenSSL AES Encryption |
Example Code
Create a new JWT
Read a JWT from cookies
More
These examples can also be found in the folder sample/