OAuth: how to test with local URLs?

后端 未结 8 1296
粉色の甜心
粉色の甜心 2020-12-02 04:57

I am trying to test OAuth buttons, but they all (Facebook, Twitter, LinkedIn) come back with errors that seem to signal that I can not test or use them from a local

相关标签:
8条回答
  • 2020-12-02 05:45

    Taking Google OAuth as reference

    • In your OAuth client Tab

      1. Add your App URI example(http://localhost:3000) to Authorized JavaScript origins URIs
    • In your OAuth consent screen

      1. Add mywebsite.com to Authorized domains
    • Edit the hosts file on windows or linux Windows C:\Windows\System32\Drivers\etc\hosts Linux : /etc/hosts to add 127.0.0.1 mywebsite.com (N.B. Comment out any if there is any other 127.0.0.1)

    0 讨论(0)
  • 2020-12-02 05:46

    You can also use ngrok: https://ngrok.com/. I use it all the time to have a public server running on my localhost. Hope this helps.

    Another options which even provides your own custom domain for free are serveo.net and https://localtunnel.github.io/www/

    0 讨论(0)
提交回复
热议问题