我为我的网站建立了一些Facebook登录。我将此参数发送到Facebook api,如此
https://www.facebook.com/dialog/oauth?client_id=myclient_id&redirect_uri=http%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php%253Fpage%253Dlogin&state=mystate&scope=email%2Cpublish_actions
在重定向过程之前一切顺利:
http://mysite.fr/mydir/index.php%3Fpage%3Dlogin?code=somecopde
我收到此错误消息
The requested URL /mydir/index.php?page=login was not found on this server.
但如果我将%3F
替换为?
中的redirect_uri
来
redirect_uri=http%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php?page%253Dlogin&state=mystate&scope=email%2Cpublish_actions
为什么会如此,我该如何调整呢?
答案 0 :(得分:0)
看起来你的双重网址编码你的获取参数
请参阅:
myclient_id&redirect_uri=http%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php%253Fpage%253Dlogin&state=mystate&scope=email%2Cpublish_actions
让我们尝试url解码你的网址: HTTP%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php%253Fpage%253Dlogin&安培;状态= mystate&安培;范围=电子邮件%2Cpublish_actions
第一次: http://mysite.fr/mydir/index.php%3Fpage%3Dlogin&state=mystate&scope=email,publish_actions
你可以看到吗?仍然编码为%3F,您的=仍然编码为%3D要解决这个问题,你不应该对你进行两次urlencode。如果这些信息不够,我需要更多地了解您的实施。