2017 © Pedro Peláez
 

library jwt-auth-module

JWT authentication module for BEAR.Sunday

image

kuma-guy/jwt-auth-module

JWT authentication module for BEAR.Sunday

  • Monday, September 26, 2016
  • by shingo-kumagai
  • Repository
  • 1 Watchers
  • 5 Stars
  • 156 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

BEAR.JwtAuthModule

Build Status Scrutinizer Code Quality, (*1)

JSON Web Token Authentication for BEAR.Sunday, (*2)

Installation

Composer install

$ composer require kuma-guy/jwt-auth-module

Module install

This package contains two modules for installing JSON Web Token Authentication., (*3)

Symmetric way

use Ray\Di\AbstractModule;
use BEAR\JwtAuth\Auth\Auth;
use BEAR\JwtAuth\SymmetricJwtAuthModule;

class AppModule extends AbstractModule
{
    protected function configure()
    {
        $this->install(new SymmetricJwtAuthModule('symmetric algorithm', 'token time-to-live', 'secret'));
        $this->bind(Auth::class)->toProvider(AuthProvider::class)->in(Scope::SINGLETON);
    }
}

Asymmetric way

use Ray\Di\AbstractModule;
use BEAR\JwtAuth\Auth\Auth;
use BEAR\JwtAuth\AsymmetricJwtAuthModule;

class AppModule extends AbstractModule
{
    protected function configure()
    {
        $this->install(new AsymmetricJwtAuthModule('asymmetric algorithm', 'token time-to-live', 'private key', 'public key', 'pass phrase'));
        $this->bind(Auth::class)->toProvider(AuthProvider::class)->in(Scope::SINGLETON);
    }
}

Authentication

your user is injected by auth provider, you need to add this line in your resource class, (*4)

use AuthInject;

The Versions

26/09 2016

dev-master

9999999-dev

JWT authentication module for BEAR.Sunday

  Sources   Download

MIT

The Requires

 

The Development Requires

by kuma-guy

jwt bear.sunday

26/09 2016

1.0.0

1.0.0.0

JWT authentication module for BEAR.Sunday

  Sources   Download

MIT

The Requires

 

The Development Requires

by kuma-guy

jwt bear.sunday