Download the PHP package fengxin2017/oauth without Composer
On this page you can find all versions of the php package fengxin2017/oauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package oauth
oauth
A simple oauth for laravel-project.
简介
基于三方登录(微信,微博,QQ,手机)mini-oauth 认证体系。
安装
发布配置
创建数据库token存储表
创建配置中oauth_model对应的模型
如何使用
比如配置中使用的auth_middleware_groups是foo。
首先认证模型需要添加Authenticatable,当然你使用laravel自带的Illuminate\Auth\Authenticatable也是没问题的。
根据第三方返回信息(比如微信的open_id之类的检索出需要认证的模型)。
调用Oauth门面类的generateTokenFor方法为认证模型颁发Token。
客户端支持get、post、header携带token发起请求。
认证中间件组
可以配置多个,互不干扰。
关于token存储
支持database和cache,使用缓存请确保框架已开启相应服务。
认证前中间件
在检索认证模型前会触发配置中before_auth中间件组。已内置域名验证中间件,如不想使用可以移除。
验证前中间件
在检索认证模型后,验证认证模型是否合法之前会触发配置文件before_check中间件组。
生成Token会触发一个事件。
删除数据库过期Token
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-4 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT