asseco-voice/laravel-jwt-authentication 问题修复 & 功能扩展

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

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

asseco-voice/laravel-jwt-authentication

Composer 安装命令:

composer require asseco-voice/laravel-jwt-authentication

包简介

Package to decode and verify JWT tokens

README 文档

README

Laravel JWT Authentication

This package enables backend authentication via JWT-token

Installation

Install the package through composer. It is automatically registered as a Laravel service provider, so no additional actions are required to register the package.

composer require asseco-voice/laravel-jwt-authentication

In order to gain access to additional configuration run

php artisan vendor:publish

This will publish the asseco-authentication.php configuration file into your config directory

Quick usage

A minimal requirement to make the package work is to set the JWT_PUBLIC_KEY in your .env file. This is the location of the public key with which the package will verify the signature of the token.

The package works out-of-the-box. Once installed the application will have a new guard registered.

'jwt-api' => [
   'driver' => 'token',
   'provider' => 'token_provider',
],

Activating it on your desired route follows the standard laravel implementation.

Route::apiResource('YourResource', 'YourController')->middleware('auth:jwt-api');

This will force the framework to use the following configuration to resolve the user from a JWT-token and injecting it as the authenticated user.

'token_provider' => [
    'driver' => 'jwt_provider'
]

The public.pem key will be fetched on the first incoming request from the configured AUTH_URL

Fetch key command

Package comes with a convenience command. The only requirement is the env value AUTH_URL.

php artisan asseco:fetch-key

The method is made to hit the configured endpoint and extract the public key from the response. By default, the command will look for the key public_key in the response, however this can be configured through a config file.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固