Javascript Facebook“无效的redirect_uri”,但网址对我来说看起来不错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8100043/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Facebook "Invalid redirect_uri", but the url looks fine to me
提问by b-ryce
I'm getting the following error when trying to authenticate to Facebook with OAuth:
尝试使用 OAuth 对 Facebook 进行身份验证时出现以下错误:
{
"error": {
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
"type": "OAuthException"
}
}
My url looks like this:
我的网址如下所示:
https://graph.facebook.com/oauth/authorize?client_id=283993944973616&redirect_uri=http://dennys-m.appspot.com/fb_login/&scope=publish_stream,email&display=popup
I know there are a lot of other posts with this problem, but I can't see what would make my url invalid. Any ideas why I'm getting this error?
我知道还有很多其他帖子有这个问题,但我看不出是什么会使我的 url 无效。任何想法为什么我会收到此错误?
回答by asdf_enel_hak
Your redirect url: http://dennys-m.appspot.com/fb_login/must match the canvas url
in https://developers.facebook.com/apps/configuration panel.
您重定向URL:http://dennys-m.appspot.com/fb_login/必须符合canvas url
在https://developers.facebook.com/apps/配置面板。
Fortunately, these days Facebook gives the error message Invalid redirect_uri: Given URL is not allowed by the Application configuration
. About a year ago no such exception appeared, just strange results.
幸运的是,最近 Facebook 给出了错误信息Invalid redirect_uri: Given URL is not allowed by the Application configuration
。大约一年前没有出现这样的异常,只是奇怪的结果。
回答by DeltaCap019
You have to register your redirect URL
at Facebook console
你必须redirect URL
在Facebook console
First go to Advanced
tab inside Settings
首先转到 Advanced
里面的标签Settings
There after scroll down to Valid OAuth redirect URIs
向下滚动到 Valid OAuth redirect URIs
register your url
there the moment you will save changes it will stop giving this exception
url
在您保存更改的那一刻在那里注册,它将停止提供此异常
回答by lord_t
In my case there was no /
at the end of mine redirect uri! No comments to fb..
就我而言/
,我的重定向 uri 末尾没有!fb没有评论。。
回答by Ratheesh Raveendran Pillai
if you are using localhost:3000
as your call back url,
For example your call back uri may like: http://localhost:3000/sessions/create
, where sessions/create
are the controller and action respectively,
then make your Canvas URL as: http://localhost:3000/
如果您使用localhost:3000
作为您的回调 url,例如您的回调 uri 可能喜欢:http://localhost:3000/sessions/create
,sessions/create
控制器和动作分别在哪里,然后将您的画布 URL 设为:http://localhost:3000/
回答by Big Dude
Something else:
It might sound stupid but read those snippets carefully.
It took me several daysto figure out why I always got this error message
我花了几天才弄清楚为什么我总是收到此错误消息
Invalid redirect_uri URI is not supported
不支持无效的 redirect_uri URI
Those curley brackets are not a part of the URI!
那些花括号不是 URI 的一部分!
Again, it might sound stupid and some of you out there might say "This would never happen to me" but if you are new into something use your brain ( I didn't ;) )
同样,这听起来可能很愚蠢,你们中的一些人可能会说“这永远不会发生在我身上”,但如果你是新手,请动动脑筋(我没有;))