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

时间:2018-08-28 01:34:18

标签: javascript heroku slack-api botkit

我在Heroku上运行了一个工作程序,该工作程序是我使用Botkit和Node.js为Slack制作的机器人。 (只有一名工作人员,没有Web流程。)当用户通过我的应用进行身份验证时,需要将其重定向。我的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 =错误代码= H14 desc =“没有运行的Web进程” method = GET path =“ /?code = 9428472352.424451020901.a0e68d7f7443a71bfe6e0786ee6e358c6fe7bf1932dadf70be295c8876 host = updooter2.herokuapp.com request_id = b33d5c47-9e91-4e5f-8ebe-7a6bd73027e4 fwd =“ 169.145.120.131” dyno = connect = service = status = 503字节=协议= https

     

2018-08-28T01:10:01.650177 + 00:00 heroku [router]:at =错误代码= H14 desc =“没有正在运行的Web进程” 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

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

1 个答案:

答案 0 :(得分:0)

重定向网址应类似于: https://updooter2.herokuapp.com/oauth

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

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

如果使用此路径,它应该工作