Download the PHP package nviimedia/pimcore-jwt-auth without Composer

On this page you can find all versions of the php package nviimedia/pimcore-jwt-auth. 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 pimcore-jwt-auth

JWT Auth

This bundle provides JWT (Json Web Token) authentication for your Pimcore API. It is based on lexik/jwt-authentication-bundle

It is compatible and tested with PHP 7 and Pimcore 6.

Table of Contents

Prerequisites

This module requires Pimcore 6 and openssl extension.

Installation

Create User class in Pimcore:

Register dependencies in app/AppKernel.php:

Generate the SSH keys :

In case first command forces you to input password use following to get the private key decrypted

Configuration

Configure the SSH keys path in your app/config/lexik_jwt_authentication.yaml :

Configure CORS configuration in app/config/nelmio_cors.yml :

Configure your app/config/security.yml :

Configure yor app/config/config.yml:

Configure your config/routing.yml :

Usage

The first step is to authenticate the user using its credentials. A classical form_login on an anonymously accessible firewall will do perfect.

Just set the provided lexik_jwt_authentication.handler.authentication_success service as success handler to generate the token and send it as part of a json response body.

Store it (client side), the JWT is reusable until its ttl has expired (3600 seconds by default). Create in Pimcore panel an object of class User and fill its credentials.

Note: You can test getting the token with a simple curl command like this:

If it works, you will receive something like this:

Use the token

Simply pass the JWT on each request to the protected firewall, either as an authorization header or as a query parameter.

By default only the authorization header mode is enabled : Authorization: Bearer {token}

About token expiration

Each request after token expiration will result in a 401 response. Redo the authentication process to obtain a new token.

Maybe you want to use a refresh token to renew your JWT. In this case you can check JWTRefreshTokenBundle.

More details

For more details head to LexikJWTAuthenticationBundle

Standards & Code Quality

This module respects PSR-2 code quality rule and our own PHPCS and PHPMD rulesets.

About Authors

Divante-logo

We are a Software House from Europe, existing from 2008 and employing about 150 people. Our core competencies are built around Magento, Pimcore and bespoke software projects (we love Symfony3, Node.js, Angular, React, Vue.js). We specialize in sophisticated integration projects trying to connect hardcore IT with good product design and UX.

We work for Clients like INTERSPORT, ING, Odlo, Onderdelenwinkel and CDP, the company that produced The Witcher game. We develop two projects: Open Loyalty - an open source loyalty program and Vue.js Storefront.

We are part of the OEX Group which is listed on the Warsaw Stock Exchange. Our annual revenue has been growing at a minimum of about 30% year on year.

Visit our website Divante.co for more information.


All versions of pimcore-jwt-auth with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
pimcore/pimcore Version ~6.9.0
lexik/jwt-authentication-bundle Version ^2.8
nelmio/cors-bundle 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 nviimedia/pimcore-jwt-auth contains the following files

Loading the files please wait ....