重现步骤
https://api.instagram.com/oauth/authorize/?client_id=xxx&redirect_uri=http%3A%2F%2Fexample.com%2Fpublisher%2Fauth%3FinviteId%3D00001000-cf33-11e4-9f26-8789dd0b3e01&response_type=code&scope=basic&type=web_server
作为引用,这些查询参数是:
client_id=xxx
redirect_uri=http%3A%2F%2Fexample.com%2Fpublisher%2Fauth%3FinviteId%3D00001000-cf33-11e4-9f26-8789dd0b3e01
response_type=code
scope=basic
type=web_server
预期行为
端点以 200 和访问 token 响应。
实际行为
端点响应:
code=400
error_type = 'OAuthException'
error_message = 'Redirect URI doesn't match original redirect URI'
What I've Investigated So Far
To confirm that this is a problem with Instagram, I checked the API docs which very clearly state that adding query parameters to the redirect URI should be possible. I also tried varying only that query parameter. For example, when replaced with this /oauth/authorize URL I get the expected behavior:
https://api.instagram.com/oauth/authorize/?type=web_server&client_id=xxx&redirect_uri=http%3A%2F%2Fexample.com%2Fpublisher%2Fauth&response_type=code&scope=basic
作为引用,这些查询参数是:
client_id=xxx
redirect_uri=http%3A%2F%2Fexample.com%2Fpublisher%2Fauth
response_type=code
scope=basic
type=web_server
笔记
这个问题实际上是 another question 的重复这实际上并没有真正成为一个问题,而且从来没有得到任何答案。
我已经向 Instagram 提交了一个错误,但我想看看是否有人发现了这个问题或提出了解决方法。
最佳答案
今天有同样的问题。要获取在请求之间传递的自定义数据,您必须将其包含为 state
参数。我的授权请求网址如下所示:
https://www.instagram.com/oauth/authorize?client_id=SOME_CLIENT_ID&response_type=code&redirect_uri=http://example.com/auth/InstagramRedirect/&state=855C0114-F860-420A-AEB1-A276644FCCEA
请注意 & 和 状态 =...
关于oauth - 向 Instagram auth redirect_uri 添加查询参数不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32590652/