2017 © Pedro Peláez
 

library passport-client-cookie

image

netsells/passport-client-cookie

  • Wednesday, May 30, 2018
  • by spamoom
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,134 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 160 % Grown

The README.md

Laravel Passport Client Cookie

This package provides the same cookie based auth that the CreateFreshApiToken middleware does, but for client_credentials. This is useful when you protect non-user routes, but still want to consume them on the frontend without introducing a proxy., (*1)

Most of the code contained in this package is taken from Laravel Passport and adapted for this use-case - all credit goes to that repo., (*2)

Installation

composer require netsells/passport-client-cookie

Add to your app.php if not using Laravel 5.5+, (*3)

    // Other service providers
    Netsells\PassportClientCookie\ServiceProvider::class,
],

Usage

In Http/Kernel.php:, (*4)

Add to your web middleware group, probably at the bottom., (*5)

\Netsells\PassportClientCookie\Middleware\CreateFreshClientCredentialsApiToken::class,

Replace your CheckClientCredentials route middleware with the passport client check:, (*6)

'client' => \Netsells\PassportClientCookie\Middleware\CheckClientCredentials::class,

Testing

You can disable the checking middleware by pulling the WithoutClientCredentialsMiddleware trait in and calling $this->withoutClientCredentialsMiddleware() at the top of your test., (*7)

The Versions

30/05 2018

dev-master

9999999-dev

  Sources   Download

MIT

by Sam Jordan

07/03 2018

0.2

0.2.0.0

  Sources   Download

MIT

by Sam Jordan

07/03 2018

0.1

0.1.0.0

  Sources   Download

MIT

by Sam Jordan