Download the PHP package mathieu-bour/guardian without Composer

On this page you can find all versions of the php package mathieu-bour/guardian. 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 guardian

Guardian

GitHub license Packagist Version Packagist GitHub issues GitHub pull requests Codecov Scrutinizer code quality

Highly configurable JSON Web Token implementation for Laravel and Lumen.

Guardian exposes an additional authentication guardian driver, which can be used like the standard session or token drivers.

Guardian follows the Semantic Versioning specification.

:heavy_exclamation_mark: The master branch should not be considered stable prior to the 1.0.0 release. :heavy_exclamation_mark:

Motivations

Our company based its back-end on the Lumen Framework and we needed a stateless identification and authentication method. We chose to use the JSON Web Tokens which combines security and ease. While some libraries exist like tymondesigns/jwt-auth or laravel/passport, they did not meet our requirements. Indeed, we wanted to have control over the cryptographic algorithms of the keys as well as to be able to use several of them.

After careful consideration, we decided to develop our own JWT library for Lumen which was later ported to Laravel and shared open-source.

Acknowledgements

Prerequisites

Installation

Simply add Guardian to your project dependencies.

Depending on the algorithm you want to use, install the corresponding cryptographic library:

Algorithm Library Required PHP extensions
ECDSA web-token/jwt-signature-algorithm-ecdsa openssl
EdDSA web-token/jwt-signature-algorithm-eddsa sodium
HMAC web-token/jwt-signature-algorithm-hmac n/a
RSA web-token/jwt-signature-algorithm-rsa openssl, gmp

If you do not know which algorithm to choose, we recommend ECDSA with the ES512 algorithm and the P-521 curve.

Laravel

Publish the default Guardian configuration:

Lumen

Copy the default Guardian configuration from vendor/mathieu-bour/guardian/config/guardian.php to config/guardian.php. Then, add the provider to your bootstrap/app.php and load the configuration with:

If you want to use the Guardian Facade, ensure that the application is loaded with Facades in your bootstrap/app.php.

Next steps

Alternatives

Here, we humbly refer to the alternatives to Guardian that we found interesting.

laravel/passport

Passport is the official Laravel library which supports JWT authentication.

Laravel makes API authentication a breeze using Laravel Passport, which provides a full OAuth2 server implementation for your Laravel application in a matter of minutes.

tymondesigns/jwt-auth

jwt-auth is a worthwhile alternative to Guardian which provides a higher-level API, such as authenticating users directly from the request credentials via a Facade. jwt-auth also provides a way to blacklist the generated tokens whereas Guardian leaves the implementation to the developer. If you are looking for a simpler way to use JWT, we highly recommend that you take a look to this library!


All versions of guardian with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
ext-sodium Version *
ext-json Version *
illuminate/auth Version ^6.0 || ^7.0
illuminate/http Version ^6.0 || ^7.0
illuminate/support Version ^6.0 || ^7.0
psr/log Version ^1.1
ramsey/uuid Version ^3.0 || ^4.0
web-token/jwt-checker Version ^2.1
web-token/jwt-core Version ^2.1
web-token/jwt-key-mgmt Version ^2.1
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 mathieu-bour/guardian contains the following files

Loading the files please wait ....