Download the PHP package lsxiao/jwt-auth without Composer

On this page you can find all versions of the php package lsxiao/jwt-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jwt-auth

注意!!!

由于该库的主要目的是JWT的实现原理的技术分享,而我目前忙于公司的Android项目,暂没有时间维护当前扩展包(对Laravel5.4的兼容性不好),并且扩展包稳定性还有待验证,不推荐使用到正式环境。

所以我推荐大家使用 https://github.com/tymondesigns/jwt-auth :),如果你有JWT相关不懂的,可以提issue,大家一起探讨。

如果你想学习JWT的实现原理,我相信本项目应该会带给你一些帮助:),配合专栏食用更佳 https://zhuanlan.zhihu.com/p/22531819

jwt-auth PHP version

Laravel/Lumen JSON Web Token 认证扩展包

待完成

引入jwt-auth到项目中

使用方法

配置jwt-auth

Laravel

jwt.php配置文件会被拷贝到项目根目录的config文件夹中

Lumen

在项目的lumen项目的根目录创建config文件夹,将配置文件复制到此处

配置auth

Laravel

在config文件夹中找到auth.php

Lumen

将配置文件复制到config文件夹

修改如下:

开启认证

修改 bootstrap/app.php,取消 auth middleware 及 AuthServiceProvider 的注释

修改 app/Providers/AuthServiceProvider.php 的 boot 方法:

用户类

用户类 User 需要确认已实现 \Illuminate\Contracts\Auth\Authenticatable 接口,默认的 User 类即可

在Controller中根据账号密码获取Token

在需要的地方刷新Token

Controller 中

Middleware 中

需要处理的异常

所有异常都继承自Lsxiao\JWT\Exception\BaseJWTException,建议在App\Exceptions\Handler处理异常,返回不同的HTTP status code

版本说明

维护人

知乎 : @面条

Github : @lsxiao

开源许可

Copyright 2016 lsxiao, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

All versions of jwt-auth with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0
illuminate/auth Version ~5.1
illuminate/contracts Version ~5.1
illuminate/http Version ~5.1
illuminate/support Version ~5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lsxiao/jwt-auth contains the following files

Loading the files please wait ....