passport.js - 带有 google-outh 策略的护照
问题描述
每当我调用 API URL 时,我正在创建用于使用 google 登录和使用 facebook 登录的 API 我收到错误: “TypeError:OAuth2Strategy 需要验证回调”
我正在使用本地服务器进行测试,这是我用 node.js 实现 google-outh-strategy 的代码
clientID: "clientId",
clientSecret: "clientsecret",
callbackURL: "http://localhost:3001/",
passReqToCallback: true
},
function (request, accessToken, refreshToken, profile, done) {
console.log(refreshToken);
console.log(accessToken);
console.log(profile);
done(null, profile)
}
));
Here is my references Docs for it :
http://www.passportjs.org/packages/passport-google-oauth2/
解决方案
推荐阅读
- python - 如何将此频率检查代码更改为不区分大小写?
- c# - 转换任何一个
> 到选项 > 在 c# LanguageExt 中 - c# - 如何在 ASP.NET Core 3.1 的 IAuthorizationHandler 中访问会话数据?
- mysql - SQL 查询 JOIN 未找到时返回 null 的两个表
- php - 在 Laravel 文件夹中执行 require_once 的问题
- mysql - 查询不返回前几个月的数据,如果为空则为零
- qt - 带有 HERE 插件的 Qt Qml Map 如何正确使用 here.token 进行身份验证
- json - 为什么 IATA 选择 XML 而不是 JSON 来提供 NDC 服务?
- jenkins - Jenkins 在同一个存储库中构建多个项目
- sql - 红移模式匹配