I have a rails app that uses facebook connect to enable user registration/login (using devise and omniauth). After reading several articles on Firesheep i decided to force ssl communications for my entire app.
I followed this tutorial to force my rails 3.0.x app to communicate only via ssl: http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/
And I followed this tutorial so that I could test the app locally using webrick on locahost:3001: http://blog.readypulse.com/2012/01/19/setup-webrick-to-serve-ssl-https-as-well-as-non-ssl-http-traffic-side-by-side/
So far so good. My app forces ssl communications throughout while running on localhost:3000
. My problem occurs when trying to communicate with facebook connect
If I change my facebook development app's site url to https://localhost:3001
, fb graph responds with
{
"error": {
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
"type": "OAuthException",
"code": 191
}
}
However, if I change the site url to http:localhost:3001
I get an error from my server saying that the connection was reset while loading the page. My browser URL bar shows that the url it tried to load was localhost:3001/auth/facebook/callback?code=MYCODEHERE
, and if I simply add, "https://" in front of that URL and reload, the page loads as expected.
Maybe my issue stems from my very basic knowledge of SSL. but i would greatly appreciate it if someone can explain to me how to setup a facebook development app to support my local testing of facebook connect over ssl?