
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
passport-qq2015
Advanced tools
QQ第三方授权登录,使用与web网站,可在express和koa等框架中使用。
代码用到了Object.assign()
,需要在 es6 的环境中使用。
$ npm install passport
整个项目采用MVC架构,基本项目结构如下图
passport-qq2015/ 项目根目录
├── lib/ 核心代码
├── package.json npm的声明文件,包含项目的依赖等
└── README.md 包含对此此项目的一些介绍,就是当前说看到的内容
passport.use('qq-token', new qqStrategy({
clientID: config.qq.appID,
clientSecret: config.qq.appKEY,
callbackURL: 'http://www.xxxx.com/auth/token/qq/callback'
},
function (accessToken, refreshToken, profile, done) {
if (!profile) {
return done(null, false);
}
return done(null, profile);
}
));
包含两个api接口。第一个请求负责跳转到授权页面,第二个请求是qq授权的回调地址,根据获得的code,依次获得accessToKen, openId, userInfo,并最终跳转到指定的地址。
example如下:
router.get('/token/qq', passport.authenticate('qq-token', {
session: false
}));
router.get('/token/qq/callback',
passport.authenticate('qq-token', {
session: false,
failureRedirect: 'http://www.fail.com'
}),
function *() {
const res = this.response;
res.redirect('http://success.com');
});
FAQs
qq authentication strategy for Passport.
We found that passport-qq2015 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.