netsells/passport-client-cookie 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

netsells/passport-client-cookie

Composer 安装命令:

composer require netsells/passport-client-cookie

包简介

README 文档

README

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.

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.

Installation

composer require netsells/passport-client-cookie

Add to your app.php if not using Laravel 5.5+

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

Usage

In Http/Kernel.php:

Add to your web middleware group, probably at the bottom.

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

Replace your CheckClientCredentials route middleware with the passport client check:

'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.

统计信息

  • 总下载量: 32.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 6
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-07