Download the PHP package marten-cz/nette-jwt-user-storage without Composer

On this page you can find all versions of the php package marten-cz/nette-jwt-user-storage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nette-jwt-user-storage

nette-jwt-user-storage

Latest Stable Version

JWT

Nette IUserStorage implementation using JWT access token instead of PHP sessions.

Disclaimer: If you don't know what JWT is, please refer to JWT draft or to JWT homepage.

On user login, the application stores jwt_access_token cookie instead of bad old PHPSESSID one. The cookie contains an encoded JWT signed by the application. The user authentication is then based on verifying the JWT rather than the session.

Warning: CSRF protection rules still apply!

This means you no longer need to solve PHP session implementation, scaling and testing problems. All the things that you would normally store in the SessionStorage can be stored in a key-value storage, where the JWT is a key.

This also means your application is ready to become SPA in the future. :)

Configuration

Register the extension in your config.neon.

Then configure its required properties.

Both the JWT and the cookie in which it's stored is by default set to expire in 20 days. If you want to fiddle with expiration time, use expiration option:

By default, jti and iat (see JWT draft) are added to your JWTs. If you don't want to use them, set generateJti and generateIat options to false.

If you want to define your own Nette\Security\IIdentity serializer, which serializes your identity implementation into the JWT body, you can implement Marten\Nette\JwtStorage\\IIdentitySerializer

and register it in configuration.

And that's it, you're ready to go!

Known issues

Discussion threads

Literature


All versions of nette-jwt-user-storage with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
nette/security Version ^3.0
nette/http Version ^3.0
firebase/php-jwt Version ^3.0|^4.0|^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marten-cz/nette-jwt-user-storage contains the following files

Loading the files please wait ...