简体   繁体   English

尝试通过password-facebook进行身份验证时出现“内部服务器错误”

[英]“Internal Server Error” when trying to authenticate via passport-facebook

What I want 我想要的是

Okay, I have a little personal blog I am developing for a hobby of mine so I am not a professional programmer. 好的,我有一个个人博客是为了我的兴趣而开发的,所以我不是专业的程序员。 I want to allow users to login to my web app via passport-facebook but it's a bit intimidating. 我想允许用户通过password-facebook登录到我的Web应用程序,但这有点吓人。 Thankfully, the git repository for this node package has a link to an example of passport-facebook for express environments . 值得庆幸的是, 此节点程序包的git存储库中有一个指向特快环境的password-facebook示例的链接。

I'm trying to run this example on heroku but I can't get it to work. 我正在尝试在heroku上运行此示例,但无法使其正常工作。 I should note that in the server.js file I edited lines 16 and 17 to: 我应该注意,在server.js文件中,我将第16和17行编辑为:

passport.use(new Strategy({
clientID: "my actual id value from the Facebook developer site",
clientSecret: "my actual secret from the Facebook developer site",

What happens 怎么了

I get a blank screen that simply says "Internal server error" when I click on the login link. 单击登录链接时,出现空白屏幕,上面仅显示“内部服务器错误”。 Please see the image: 请看图片:

错误信息

Presumably the OAuth redirect URI is correct, because if it's altered in any way I get a different error as can be seen below. OAuth重定向URI大概是正确的,因为如果以任何方式对其进行了更改,我都会收到不同的错误,如下所示。 In fact I am convinced that the redirect URI has been successfully white listed because the first time I ran the app Facebook did popup and say an app wanted access as expected. 实际上,我确信重定向URI已成功列入白名单,因为我第一次运行该应用程序时,Facebook确实弹出了窗口,并说一个应用程序希望按预期进行访问。

在此处输入图片说明

So I believe I have the correct redirect URI which is https://agile-thicket-43367.herokuapp.com/return . 因此,我相信我拥有正确的重定向URI,即https://agile-thicket-43367.herokuapp.com/return

My request 我的请求

Could someone either read the git repository I linked for passport-facebook with express and just glance at the code for any potential errors or could someone try cloning it and running it on Heroku and tell me how it goes on their end? 有人可以阅读我用明文链接到通行证-facebook的git存储库,然后看一下代码中是否存在任何潜在错误,或者有人可以尝试克隆它并在Heroku上运行它,并告诉我它如何进行? I'm kind of stumped here as it's something that has been updated in the past month so I doubt it's out of date and it doesn't seem too complex to get it up and running. 我有点受困,因为它在过去的一个月中已更新,因此我怀疑它已经过时,并且启动和运行似乎不太复杂。

On the Facebook developer side of things, I just added my app domain, website domain, the Facebook login product and OAuth redirect URI. 在Facebook开发人员方面,我刚刚添加了我的应用程序域,网站域,Facebook登录产品和OAuth重定向URI。 I didn't change any other settings. 我没有更改任何其他设置。

The internal server error means your Heroku server is running into an error while loading. 内部服务器错误表示您的Heroku服务器在加载时出现错误。 If you look at the server logs, it will give you a description of the error it is running into when trying to initially load your application. 如果您查看服务器日志,它将为您提供在尝试最初加载应用程序时遇到的错误的描述。

Using the Heroku command line tools, you can simply type heroku logs and it will show you the last 100 lines which should contain your error. 使用Heroku命令行工具,您只需键入heroku logs ,它将显示应该包含错误的最后100行。

https://devcenter.heroku.com/articles/logging https://devcenter.heroku.com/articles/logging

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM