简体   繁体   English

KOALA + FACEBOOK GRAPH给出了FARADAY错误(ConnectionFailed-拒绝连接-connect(2))

[英]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.

相关问题 # <Faraday::ConnectionFailed> 连接被拒绝 - 连接(2) - #<Faraday::ConnectionFailed> Connection refused - connect(2) 法拉第:: ConnectionFailed,连接被拒绝 - 连接(2)为“localhost”端口9200 - Faraday::ConnectionFailed, Connection refused - connect(2) for “localhost” port 9200 法拉第:: ConnectionFailed连接被拒绝 - 连接(2)为“localhost”端口9200 - Faraday::ConnectionFailed Connection refused - connect(2) for “localhost” port 9200 法拉第:: ConnectionFailed,连接被拒绝 - 连接(2)为“localhost”端口9200错误Ruby on Rails - Faraday::ConnectionFailed, Connection refused - connect(2) for “localhost” port 9200 Error Ruby on Rails 无法打开到localhost的TCP连接:9200(连接被拒绝 - 连接(2)为“localhost”端口9200)(法拉第::连接失败) - Failed to open TCP connection to localhost:9200 (Connection refused - connect(2) for “localhost” port 9200) (Faraday::ConnectionFailed) Faraday :: ConnectionFailed:保存到mongo数据库时拒绝连接 - Faraday::ConnectionFailed: connection refused while saving to mongo database Rspec无法运行:在connection_for中进行救援:连接被拒绝:localhost:7475(法拉第:: ConnectionFailed) - Rspec can't run: rescue in connection_for': connection refused: localhost:7475 (Faraday::ConnectionFailed) Faraday :: Connection在/ auth / facebook / callback处失败getaddrinfo:名称或服务未知 - Faraday::ConnectionFailed at /auth/facebook/callback getaddrinfo: Name or service not known SSL_connect SYSCALL 返回=5 errno=0 state=SSLv2/v3 read server hello A - Faraday::Error::ConnectionFailed - SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A - Faraday::Error::ConnectionFailed Rails-考拉/法拉第宝石执行过期错误 - Rails - Koala / Faraday Gems Execution Expired Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM