Facebook App: localhost no longer works as app domain

后端 未结 13 1340
我寻月下人不归
我寻月下人不归 2020-11-28 02:33

I\'ve been writing a game for Facebook using Rails and jQuery. Since I started using the Facebook Javascript SDK, using localhost as an app domain seemed to work just fine.

13条回答
  •  再見小時候
    2020-11-28 03:06

    I ran into an issue with my Rails app that I usually run with http://localhost:3000 because Facebook now requires the Valid OAuth redirect to use https.

    To use https locally, I used [ngrok][1] which allows you to use https by providing a tunnel. To do this:

    1. I went to their website and downloaded their program
    2. I extracted the file for the program
    3. In my console, I went into the directory where ngrok was extracted to and entered 'grok http 3000' on my Windows machine, others may use './grok http 3000'
    4. After entering that, ngrok provided a https address which I put into the Valid OAuth Redirect URIs field in Facebook
    5. Then I started my server and was able to access it using that https address instead of localhost:3000

提交回复
热议问题