[英]KOALA + FACEBOOK GRAPH gives FARADAY error (ConnectionFailed - Connection Refused - connect(2))
I am using koala(1.3.0) with rails (3.0.7). 我正在使用带导轨(3.0.7)的koala(1.3.0)。
This is how I use them. 这就是我使用它们的方式。
Link to click function of facebook 链接到facebook的点击功能
<%= link_to 'Facebook Login', Koala::Facebook::OAuth.new.url_for_oauth_code(:callback => facebook_redirect_url), :class => "facebook_login" %>
This goes to following link 这转到以下链接
https://graph.facebook.com/oauth/authorize?client_id=MY_APP_ID&redirect_uri=http%3A%2F%2Fexample.example.com%2Ffacebook%2Fredirect
Now I get the code in params in my facebook controller of redirect. 现在,我在重定向的facebook控制器中的params中获得了代码。 Following is what I do next in redirect method of facebook controller. 以下是我接下来在facebook控制器的重定向方法中要做的事情。
session[:access_token] = Koala::Facebook::OAuth.new(url_r).get_access_token(params[:code]) if params[:code]
but this line of code gives faraday ConnectionFailed error. 但是这行代码给出了法拉第ConnectionFailed错误。
I am stuck at this point. 我被困在这一点上。 Can't figure out what is the reason behind this. 无法弄清楚这背后的原因是什么。
I have also done the following with this another way also. 我还用另一种方法完成了以下操作。 After I get code in params 我在params中获得代码后
facebook_access_token_redirect_link = "https://graph.facebook.com/oauth/access_token?client_id=355***************&redirect_uri=#{url_i}&client_secret=MY_APP_SECRET&code=#{params[:code]}"
and redirect to this link. 并重定向到此链接。 But then I get an error from facebook Error validating verification code 但是然后我从facebook得到了一个错误验证码无效
I don't understand this also. 我也不明白。
Any help regarding this is appreciated. 对此任何帮助表示赞赏。
Thanks. 谢谢。
It was a silly thing. 这是一个愚蠢的事情。 The server I was hosting my app at has banned all https connections . 我托管我的应用程序所在的服务器已禁止所有https连接 。
Removed that restriction and I got koala working. 取消了该限制,我让考拉开始了工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.