gpt4 book ai didi

javascript - 如何为部署到运行工作进程的 Heroku 的应用程序使用重定向 URI?

转载 作者:行者123 更新时间:2023-11-30 06:23:01 28 4
gpt4 key购买 nike

我有一个工作进程在 Heroku 上运行,用于我使用 Botkit 和 Node.js 为 Slack 制作的机器人。 (只有一名工作人员,没有网络进程。)当用户使用我的应用程序进行身份验证时,他们需要被重定向。我的 Heroku 应用程序称为“updooter2”,其默认域为“https://updooter2.herokuapp.com/”。在我的 Slack 应用程序设置中,重定向 URI 被列为“https://updooter2.herokuapp.com/ ”。我使用 Slack 提供的链接通过 OAuth 流程发送给用户:

https://slack.com/oauth/authorize?client_id=xxxxxxxxx&scope=bot,reactions:write,groups:history,channels:history,channels:read

此链接按预期将他们重定向到“https://updooter2.herokuapp.com/”。但是网页无法显示,认证失败。在我的应用程序日志中,我有以下内容:

2018-08-28T01:10:01.227047+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/?code=9428472352.424451020901.a0e68d7f7443a71bfe6e0786ee6e358c6fe7bf1932dadf70be295c8f76b8763f&state=" host=updooter2.herokuapp.com request_id=b33d5c47-9e91-4e5f-8ebe-7a6bd73027e4 fwd="169.145.120.131" dyno= connect= service= status=503 bytes= protocol=https

2018-08-28T01:10:01.650177+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=updooter2.herokuapp.com request_id=9a49db8c-5d0a-4f7f-8c95-e94562abe20f fwd="169.145.120.131" dyno= connect= service= status=503 bytes= protocol=https

在这种情况下,我如何验证我的应用程序的用户,理想情况下将进程数保留给工作人员?谢谢!

最佳答案

重定向 url 应该是这样的: https://updooter2.herokuapp.com/oauth

看看: https://botkit.ai/docs/provisioning/slack-events-api.html

如果您遵循本指南,然后访问您的应用程序,您应该会收到一个安装链接,该链接可用于将机器人添加到您的 slack 团队中。您可能还想确保您使用的是入门工具包中的 Heroku 部署链接: https://github.com/howdyai/botkit-starter-slack#getting-started

如果您使用此路径,它应该有效

关于javascript - 如何为部署到运行工作进程的 Heroku 的应用程序使用重定向 URI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52048920/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com