English 中文(简体)
OAuth:如何与当地的URLs测试?
原标题:OAuth: how to test with local URLs?

我正试图测试OAuth,但所有(Facebook、Twitter、LinkedIn)都发现了似乎表明我无法从 当地<>/m>测试或使用这些错误。 URL.

如果人们似乎都需要non-dev<>m>和non- local连接环境,那么人们通常如何与OAuth一道工作?

最佳回答

Update October 2016: Easiest now: use lvh.me which always points to 127.0.0.1, but make sure to verify that this is still true every time you need to invoke it (because domains can expire or get taken over, and DNS poisoning is always a concern)

www.un.org/spanish/ga/president

由于申请由浏览器发出,作为吉大港山区再直接反应,你可以设立你的影子档案或等同点一个领域,而不是<条码>。

Say for example you register the following callback with Twitter: http://www.publicdomain.com/callback/. Make sure that www.publicdomain.com points to 127.0.0.1 in your hosts file, AND that twitter can do a successful DNS lookup on www.publicdomain.com, i.e the domain needs to exist and the specific callback should probably return a 200 status message if requested.

www.un.org/spanish/ga/president

我刚刚读到以下条款:,与这一问题有关:。 附录 oAuth callsbackUrl - localhost development

援引该条:

或者,你可以使用URL缩短服务。 仅仅缩短了[当地东道地方的URL,例如http/ localhost:80/twitter_questback],并将缩短的URL登记为“你”的提示。

这应当比在东道方档案中进行敲诈更容易。

请注意,现在(Aug 14)不大可能允许与当地东道方连接;然而,谷歌链接缩短工程。

PS edit:(Nov 18): 谷歌链路缩短器停止支持当地托管或127.0.0.1。

问题回答

Or you can use https://tolocalhost.com/ and configure how it should redirect a callback to your local site. You can specify the hostname (if different from localhost, i.e. yourapp.local and the port number). For development purposes only.

澳门用户,<代码>/etc/hosts文档。 如果只读到<条码>,你必须使用<条码>。 经授权, o光服务器发送了URL的电话,由于电离层电离灯被送上了当地浏览器,当地国家航天中心将开展工作:

127.0.0.1       mylocal.com

Set your local domain to mywebsite.example.com (and redirect it to localhost) -- even though the usual is to use mywebsite.dev. This will allow robust automatic testing.

虽然批准<代码>.test和.dev,但不允许批准example.comis 准许在ogle oauth2中查阅。

(您可在主机档案中将任何领域转至当地东道方(unix/linux:/etc/hosts)

Why mywebsite.example.com?
Because example.com is a reserved domain name. So

  1. there would be no naming conflicts on your machine.
  2. no data-risk if your test system exposes data to not-redirected-by-mistake.example.com.

You can edit the hosts file on windows or linux Windows : C:WindowsSystem32Driversetchosts Linux : /etc/hosts

localhost name resolution is handled within DNS itself.

127.0.0.1 我的网站。

在你完成测试之后,你只是评论了你补充的一条线,使人无法理解。

127.0.0.1 我的网站。

页: 1 页: 1

如果你想测试一下你应该遵循这些步骤......

“set

如果你使用<条码>开放服务器<>,>进入小组,点击<条码>aliases tab,点击下点击<条码> 当地东道<>/代码>并选择。

现在,你应该选择你的地方网络项目根子,点击即将开始下降的下一个滴水。

并点击一个叫做add和重新启用。

now your local project available on this link http://localhost/ also you can paste this local url to google auth api to redirect url field...

如果我正确理解,你想要处理转头给你的地方招待所,而不是你。 许多OAuth2服务供应商不许设置一个直线的旋转机,以取代未经加密的终点站(http://www.un.org)。

我在此提议。

随附<代码>2>。 间接 Url endpoint:

1. https://yourapp.com/handle-oauht             (production)
2. https://yourapp.com/handle-oauht/localhost   (local dev)

转来的<代码>2.申请到您的当地东道方代码

了解在生产中不受保护的<代码>2.并不好。

就我而言,就Gite Hub oauth而言,我刚刚创建了一个新的 o配置,例如“My App localhost”,并将这一配置用于当地托管和目前的生产。

工作像一个药房?

以谷歌为参考

  • www.un.org/spanish/ecosoc 页: 1

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

    1. Add mywebsite.com to Authorized domains
  • Edit the Hosts file onwinds or linux 视窗C:Windows C: Windows System32Driversetchosts: /etc/hosts, 添加127.0.0.1 mywebsite.com (N.B. comment out any if there is any other 1270.0.1)





相关问题
ASP.NET WebService deny remote access

I ve created an ASP.NET WebService that is to be consumed using ASP.NET Ajax. The WebService is located on the same box and same web application that it is to be used by, so I do not want to allow ...

IOException when making HttpWebRequest to local ASHX file

Greetings, all. Here is my situation. I am attempting to make an HttpWebRequest to a local handler file and I keep getting the following exception: Unable to read data from the transport connection:...

Localhost issue with Net.Msmq endpoints on Windows 7

I ve just moved my development to a Win 7 64-bit machine and am having some wcf endpoint issues. As far as I can see the net.msmq endpoints that point to localhost do not work. The messages do get ...

Allowing "Cross-Site" calls between local ports

I m working on a Google Web Toolkit driven site that communicates via AJAX to a WCF server. Once deployed the GWT code will run in the same domain as the WCF service but when developing/debugging ...

Rmi connection refused with localhost

I have a problem using java rmi: When I m trying to run my server, I get a connectException (see below). Exception happens when executing the rebind method: Runtime.getRuntime().exec("rmiregistry ...

Updating your blog from a localhost version

Okay, I trust this is not a ServerFault question, though it has something to do with server settings, the main issue might concern some programming. I use Wordpress as my blogging platform, only ...

send email from localhost

I m try learn about email in rails. I m developing something on localhost. Is it possible to send an email from localhost to say a normal mail account like gmail? Do I have a install a mail server? I ...

Visual Studio Localhost Redirect Problem Asp.net

I have a test site running on Visual Studio 2008. When I try to debug and it opens up the browser through localhost, I can this error"Firefox has detected that the server is redirecting the request ...