Home  >  Article  >  Backend Development  >  新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

WBOY
WBOYOriginal
2016-06-06 20:40:111435browse

新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

发送的$redirect URL
https://api.weibo.com/oauth2/authorize?client_id=2644893821&redirect_uri=http://xxxx.lab/closewin%3Fsnsapi%3Dsina%26backUrl%3D&response_type=code

都是本地的

我测试了另外一个开发环境
本地
http://localhost:1002/sina/callback.php

居然授权成功了

再调试加上
.'&backUrl='.$_GET['backUrl']是多了这个原因

本地调试是这个原因了,上线应该没有这个问题

回复内容:

新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

新浪微博本地开发,回调地址都一样,可是一直是error:redirect_uri_mismatch

发送的$redirect URL
https://api.weibo.com/oauth2/authorize?client_id=2644893821&redirect_uri=http://xxxx.lab/closewin%3Fsnsapi%3Dsina%26backUrl%3D&response_type=code

都是本地的

我测试了另外一个开发环境
本地
http://localhost:1002/sina/callback.php

居然授权成功了

再调试加上
.'&backUrl='.$_GET['backUrl']是多了这个原因

本地调试是这个原因了,上线应该没有这个问题

要在同一个域内
如果你的回调域名是:a.sina.com

那你的 url就应该是 xx.sina.com/xxx/aaa?xxx 这样的

另外你的 回调域名 配置没有?

应该有这个问题,回调地址好像不能带参数。有个解决方案参考:http://www.xtwind.com/yar-wordpress-twitter-wall-plug-in.html

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn