开发者

Is it possible to test out Oauth Login Authentication (Facebook, Twitter, Google) without a domain and hosting?

开发者 https://www.devze.com 2023-03-30 17:37 出处:网络
Is there a way without act开发者_高级运维ual domain name and a hosting ? Can we use localhost in some way ?

Is there a way without act开发者_高级运维ual domain name and a hosting ?

Can we use localhost in some way ?

I am using Python and Django !


Yes, just use url shorteners to create short urls kind of "localhost:port" and then register that shortened url as the callback url for your app.

FYI: some url shorteners don't allow you to shorten "localhost:port" urls. I suggest you to use goo.gl


I have a domain name and hosting but when I need to try the Oauth Authentication, what I do is:

Modify the hosts file to map a random domain to your local ip.

For example in windows, I modify the file 'C:\WINDOWS\system32\drivers\etc\hosts' adding the following line:

127.0.0.1    www.yourdomain.com

BTW, this domain doesn't need to be registered


This is what I have found out :

It can be done, simply by using 127.0.0.1 in the callback/redirect uri

It worked and I am able to test my app on localhost.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号