Slack Oauth/授权API调用 [英] Slack Oauth/Authorize API Call

查看:165
本文介绍了Slack Oauth/授权API调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是OAuth(和Slack API)的新手,对Slack的 OAuth的第1步有疑问流量.

I'm new to OAuth (and the Slack API) and have a question regarding Step 1 of Slack's OAuth Flow.

它说:您的Web或移动应用程序应将用户重定向到以下URL: https://slack.com/oauth/authorize ".起初我以为我应该执行XHR请求,但后来才明白那不是我想要的.

It says "Your web or mobile app should redirect users to the following url: https://slack.com/oauth/authorize". At first I thought I should do an XHR request but then came to understand that that is not what I want.

经过更多研究,我发现初始的oauth/authorize请求应作为直接请求发送到浏览器中.我的问题是我无法开始想象应该怎么做.我一直在引用此教程的某些部分(向下滚动到"Web服务器应用程序"部分),但无法绕过oauth/authorization请愿书.

After more research, I found that the initial oauth/authorize request should be sent as a direct request in the browser. My problem is I can't begin to visualize how this should be done. I've been referencing parts of this tutorial (scroll down to 'Web Server Apps' section) but it doesn't help me to be able to wrap my head around the oauth/authorize petition.

因此,基本上,我正在寻找可以更好地向我解释最初的请愿书的方式的人.任何帮助都将不胜感激!

So basically, I'm looking for someone to better explain to me how that initial petition is supposed to be made. Any and all help is greatly appreciated!

预先感谢

推荐答案

您应该查看松弛按钮文档.

您将在其中找到slackapp的示例,例如:

There you will find an example for your slackapp, something like:

<a href="https://slack.com/oauth/authorize?scope=incoming-webhook&client_id=CLIENT_ID">
   <img alt="Add to Slack" height="40" width="139" 
   src="https://platform.slack-edge.com/img/add_to_slack.png" />
</a>

此按钮要求对包含传入的Webhook的slackapp进行授权,您可以在范围内添加更多所需功能,以逗号分隔它们. scope=incoming-webhook,commands,bot,channels:read

This button asks for authorization for a slackapp that includes incoming webhooks, you can add more features needed inside scope separating them by commas. scope=incoming-webhook,commands,bot,channels:read

在您的教程链接中,当您说应该将它们链接到https://oauth2server.com/auth?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&scope=photos

As of your tutorial link, when it says you should link them to https://oauth2server.com/auth?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&scope=photos

是指将其包装为用户的按钮:

It is refering to wrap that into a button for the user:

<a href="https://oauth2server.com/auth?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&scope=photos">
   Auth Button
</a>

希望这有助于弄清/oauth/authorize

这篇关于Slack Oauth/授权API调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆