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

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

问题描述

我正在开发一个使用 Facebook 登录的网站.现在,我希望能够在我的生产环境和我的开发环境中使用它.

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.

在 Facebook 上,我可以提供一个站点 URL,Facebook 可以重定向到该 URL.这在我的开发阶段效果很好,但现在我希望它既可以在生产中使用,也可以在开发我的解决方案时使用.

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.

我想一种方法是使用我的域导航在本地 IIS 上运行我的应用程序并更改我的主机文件,但这并不是最简单的解决方案!?

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?

推荐答案

更新:截至 2018 年,此设置的路径现在为 Products > Facebook Login > Settings > Client OAuth Settings 其余部分答案仍然有效.

Update: As of 2018 the path to this setting is now Products > Facebook Login > Settings > Client OAuth Settings the rest of this answer is still valid.

有更好的方法.您只需要将本地主机的有效回调 URL 添加到设置">高级">OAuth 设置".

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

此方法允许您仍然拥有生产网站 URL,同时允许来自开发、登台、生产等的 oauth.

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

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

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