问题标签 [passport-github2]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
129 浏览

node.js - passport-github2 在电子邮件字段中返回 null

passport-github2在电子邮件字段中返回 null,即使{scope: ['user:email']}已传递给passport.authenticate('github', {scope: ['user:email'] , session: false})(req, res, next)

0 投票
1 回答
386 浏览

node.js - Passport Github 策略不起作用并抛出错误

下面的代码对我很生气。我看不出有什么问题。

每次我尝试进行身份验证时都会引发一个大错误。请帮忙。

编辑了问题并按照@jasonandmonte 所说的那样做了,现在我明白了:我现在按照答案中的说明得到。

0 投票
0 回答
106 浏览

node.js - 如何使用passport-github2通过github企业(托管在ec2中)验证我的localhost nodejs客户端?

我正在尝试通过 github 企业对我的 nodejs 客户端进行身份验证。nodejs 客户端在我自己的机器(localhost)中,github 企业托管在 ec2 机器中。github 企业有 https 的自签名 SSL 证书。我还为 localhost 实现了一个自签名 SSL 证书。我在我的 nodejs 客户端中使用了 passport-github2 来通过 github 企业进行身份验证。但是当我试图验证这个错误时,

我也尝试过使用 HTTP 协议进行身份验证(没有本地主机的自签名 SSL 证书),但它也不起作用。这个问题只出现在 github 企业。当我尝试使用https://github.com进行身份验证时,它工作正常。

这是我的 nodejs 客户端使用的代码片段

0 投票
0 回答
258 浏览

javascript - 错误:请求失败,状态码为 404,Axios 尝试使用 passport-github2 获取 github 用户电子邮件

当我在我的系统上本地运行此代码时,它工作正常,但是一旦我将代码发送到登台和生产,我就会收到错误

我无法理解为什么会出现此错误并且我也无法获取用户电子邮件,但在本地此代码工作正常,我能够获取与用户的 github 关联的所有电子邮件。