##支持功能
- 企业微信登录
$ npm install passport-qyweixin
passport.use(new QYStrategy({
appID: {APPID}, // corpid
agentID: {agentID},
secretKey: {secretKey}, // corpsecret
state: {state} || 'login' // 默认 login
redirectUrl: {redirectUrl},
getuserdetail: {getuserdetail} || false // 获取用户相信信息
passReqToCallback: {passReqToCallback} || false // 默认false
},
function(user, done) {
if (user && user.userid) {
done(null, user)
} else {
done(null, false)
}
}
));
router.get('/auth/xx', passport.authenticate('qyweixin', {
failureRedirect: '/auth/fail',
successReturnToOrRedirect: '/'
}));
If no callbackURL is specified, the same request url will be used.
router.get('/auth/wechat/qyweixin', passport.authenticate('qyweixin', {
failureRedirect: '/auth/fail',
successReturnToOrRedirect: '/'
}));
Copyright (c) 2016 Sharkseven
Licensed under the MIT license.