【问题标题】:Deploying Github-Passport-Stategy Integrated App with Now立即部署 Github-Passport-Stategy 集成应用程序
【发布时间】:2018-08-06 13:12:19
【问题描述】:

我是应用程序部署的新手,我有一个 Express 应用程序,它使用 Github 的 Passport 策略对用户进行身份验证并将其保存到(远程)MongoDB 数据库,当使用 localhost 时,我的应用程序按预期工作。

我正在使用 Zeit Now(OSS 计划)CLI 工具,该工具与 NPM 一起全局安装。

问题 当我在项目文件夹的根目录中使用“now”部署我的应用程序,然后转到“https://github.com/settings/applications/app”并从“http://localhost:3000/auth/github/callback”交换主页 URL 和“auth/github/callback”[回调] URL使用 Now 生成的 URL - 所以它变成“https://app-name-pxwlglhegg.now.sh/auth/github/callback”我得到 redirect-uri-mismatch :

https://app-name-pxwlglhegg.now.sh/auth/github/callback?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch 

我试了好几次都搞不定。

【问题讨论】:

  • 您在 Google 开发者控制台中的授权重定向 URI 是什么?是 localhost:3000 吗? localhost:3000 是您使用的唯一本地服务器吗?

标签: node.js express github passport.js


【解决方案1】:

您更改了 GitHub 上的回调,但您的应用程序中的相同设置没有更改。所以它们不匹配。

【讨论】:

    猜你喜欢
    • 2021-12-07
    • 1970-01-01
    • 1970-01-01
    • 2011-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-14
    • 1970-01-01
    相关资源
    最近更新 更多