Download the PHP package fmwww/passport-wechat-oauth-grant without Composer
On this page you can find all versions of the php package fmwww/passport-wechat-oauth-grant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download fmwww/passport-wechat-oauth-grant
More information about fmwww/passport-wechat-oauth-grant
Files in fmwww/passport-wechat-oauth-grant
Download fmwww/passport-wechat-oauth-grant
More information about fmwww/passport-wechat-oauth-grant
Files in fmwww/passport-wechat-oauth-grant
Vendor fmwww
Package passport-wechat-oauth-grant
Short Description Wechat Oauth Grant For Passport
License
Package passport-wechat-oauth-grant
Short Description Wechat Oauth Grant For Passport
License
Please rate this library. Is it a good library?
Informations about the package passport-wechat-oauth-grant
passport-wechat-oauth-grant
增加一个可以通过微信Oauth授权code登录passport的Grant
安装
通过Composer安装
如果你的Laravel版本 < 5.5, 你需要在 config/app.php
的providers数组中增加:
配置
使用之前需要先配置好微信的 app_id
和 app_secret
使用下面的命令拷贝配置文件到 config
:
推荐使用
.env
文件进行配置
用法
- 使用POST方法去请求
https://your-site.com/oauth/token
- POST请求体里的需要将grant_type设置为wechat_oauth,同时将code设置为微信返回的授权code
- 系统将会根据
config/auth.php
里面的api guard
设置的用户模型去寻找用户,如果用户模型定义了findForWechatOauth
方法,那么就会使用这个方法返回的用户进行认证,否则就会根据openid
字段去寻找用户进行认证。 - 如果用户存在,就会成功返回
access_token
和refresh_token
。例子
请求方法
自定义 findForWechatOauth
方法
All versions of passport-wechat-oauth-grant with dependencies
PHP Build Version
Package Version
The package fmwww/passport-wechat-oauth-grant contains the following files
Loading the files please wait ....