【发布时间】:2020-01-21 08:55:52
【问题描述】:
我有一个需要文档 ID 的网页。我使用松弛身份验证进行身份验证。 (因为网页是从松弛通道请求的)。 Slack 需要重定向 URL。那么我怎样才能把这个动态重定向 URL 放在 slack 中呢?
网址是 => http://localhost:3000/document/ 我试着这样写 => http://localhost:3000/document/ 但它没有用。
我的代码如下所示:
router.get('/res', (req, res) =>{
console.log(req.query.code);
var url = 'https://slack.com/api/oauth.access?code='+req.query.code+'&client_id=<the client_id>&client_secret=<client_secret>&redirect_uri=http://localhost:3000/document/25/';
axios.get(url)
.then(response => {
res.send(response.data);
})
.catch(error => {
console.log('error');
});
});
我想在代码中进行身份验证后获得第 25 个文档。这 25 的值是动态值。
这是我尝试过的:http://localhost:3000/document/
【问题讨论】:
-
你能显示一些代码吗?你试过什么
-
redirect url 是认证后要重定向的 url,我认为不可能在重定向 URL 中提供更改参数
-
@Hrishi 哦。有什么我可以做的吗?
标签: python django oauth-2.0 slack slack-api