passport-weapp
v1.1.1
Published
passport strategy for authenticating with wechat mini program
Downloads
6
Maintainers
Readme
passport-weapp
Passport for 微信小程序
Passport strategy for authenticating with Wechat Mini Program
##支持功能
- 微信小程序登录
安装
$ npm install passport-weapp
使用
Configure Strategy
passport.use(new WeappStrategy({
appID: {APPID},
name:{默认为wechat,可以设置组件的名字}
appSecret: {APPSECRET},
getToken: {getToken},
saveToken: {saveToken}
},
function(accessToken, refreshToken, profile,expires_in, done) {
return done(err,profile);
}
));
The `getToken` and `saveToken` can be provided to initialize Wechat OAuth instance.
Authenticate Requests
router.get("/auth/weapp", passport.authenticate("weapp", options));
options
- Optional. Can include the following:
state
- Override state for this specific API callcallbackURL
- Override callbackURL for this specific API callscope
- Override scope for this specific API call
If no callbackURL is specified, the same request url will be used.
License
Copyright (c) 2019 jeff-tian
Licensed under the MIT license.