2017 © Pedro Peláez
 

library tokenizer

A very lightweight token system for micro-services

image

mathewberry/tokenizer

A very lightweight token system for micro-services

  • Wednesday, August 9, 2017
  • by berry9mathew
  • Repository
  • 1 Watchers
  • 2 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 3 % Grown

The README.md

Tokenizer

A very lightweight token system for micro-services, (*1)

Installation Lumen

Service Provider

Remove, (*2)

$app->register(App\Providers\AuthServiceProvider::class); 

Add, (*3)

$app->register(Mathewberry\Tokenizer\TokenizerServiceProvider::class); 

Route Middleware

Remove, (*4)

'auth' => App\Http\Middleware\Authenticate::class, 

Add PHP 'auth' => Mathewberry\Tokenizer\Middleware\Authenticate::class,, (*5)

Generate a new token

php artisan token:generate, (*6)

Implement a token

Copy your generated token into a new key in your .env called API_TOKEN, (*7)

How to use

When ever your make a call just pass the header api_token and the value is the value of the token in your .env., (*8)

Make sure your route or controller is using the auth middleware., (*9)

### Example, (*10)

class DomainController extends Controller
{
    public function __construct()
    {
        $this->middleware(['auth']);
    }

    public function index()
    {
        $domains = Domain::get();

        return response($domains, 200);
    }
}

It's that simple, your micro-service is now that little bit more secure., (*11)

The Versions

09/08 2017

dev-master

9999999-dev

A very lightweight token system for micro-services

  Sources   Download

GNU

The Requires

 

The Development Requires

by Mathew Berry

09/08 2017

0.2.4

0.2.4.0

A very lightweight token system for micro-services

  Sources   Download

GNU

The Development Requires

by Mathew Berry

09/08 2017

0.2.3

0.2.3.0

A very lightweight token system for micro-services

  Sources   Download

GNU

The Development Requires

by Mathew Berry

17/04 2017

0.1.3

0.1.3.0

A very lightweight token system for micro-services

  Sources   Download

GNU

The Requires

 

by Mathew Berry

29/03 2017

0.1.2

0.1.2.0

A very lightweight token system for micro-services

  Sources   Download

GNU

The Requires

 

by Mathew Berry

29/03 2017

0.1.1

0.1.1.0

A very lightweight token system for micro-services

  Sources   Download

GNU

The Requires

 

by Mathew Berry

29/03 2017

0.1

0.1.0.0

A very lightweight token system for micro-services

  Sources   Download

GNU

The Requires

 

by Mathew Berry