【发布时间】:2012-09-14 16:45:37
【问题描述】:
我正在尝试通过 facebook 进行身份验证,我有一个 sinatra 应用程序可以在 twitter 上正常工作。
app.rb
use OmniAuth::Builder do
provider :twitter, 'xxx', 'yyy'
provider :facebook, 'xxx', 'yyy', :redirect_uri => 'http://localhost:9393/auth/facebook'
end
我在我的视图中引用了 facebook 链接,例如,
%a{:href=>"/auth/twitter"} Sign In To Twitter
%a{:href=>"/auth/facebook"} Sign In To Facebook
我被退回
看起来像
{
"error": {
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
"type": "OAuthException",
"code": 191
}
}
据我所知,我的设置看起来是正确的。很多帖子都关于这个问题与 facebook 和应用程序注册的 url 相关联。
在 facebook 上,此应用注册为
Site URL
http://localhost:9393/
Site Domain
http://localhost:9393/
谢谢。
【问题讨论】: