Facebook登录 - 如何在本地主机和生产中开发? [英] Facebook login - how to develop on both localhost and in production?

查看:214
本文介绍了Facebook登录 - 如何在本地主机和生产中开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用Facebook登录的网站。现在,我想能够在我的生产环境以及我的开发环境中得到这个工作。



在Facebook上,我可以给ONE网站,Facebook可以重定向到。这在我的开发阶段工作很好,但是现在我想要它在生产中工作,而且在开发我的解决方案的同时。



我想有一种方法是运行我的应用程序在本地IIS与我的域名navn并更改我的主机文件,但这不能认真是最容易的解决方案!



- 什么是

解决方案

有一个更好的方法。您只需要将本地主机的有效回叫网址添加到设置>高级>OAuth设置。





此方法允许您仍然拥有您的生产网站URL,同时允许从开发,分期,生产等方面的oauth 。


I am developing a website which uses the Facebook login. Now, I want to be able to get this to work both in my production environment, as well as in my development environment.

On Facebook, I can give ONE site url, which Facebook can redirect to. This worked great during my development phase, but now I want it both to work in production, but also while developing my solution.

I guess one way would be to run my application on the local IIS with my domain-navn and change my hosts file, but that can't seriously be the most easy solution!?

- What is the easiest way to get it to work in both environments?

解决方案

There is a better way. You just need to add valid callback URL's for your localhost to Settings > Advanced > OAuth Settings.

This method allows you still have your production website URL while allowing oauth from dev, staging, production, etc.

这篇关于Facebook登录 - 如何在本地主机和生产中开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆