407代理验证需要 [英] 407 Proxy Authentication Required

查看:1243
本文介绍了407代理验证需要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在django应用中使用django-social-auth。虽然我的Mac上的一切都OK,但是当我尝试在Windows机器上使用相同的代码时,我需要407代理验证。

I'm trying to use django-social-auth in my django app. While everything is ok on my mac, I got 407 Proxy Authentication Required when I'm trying to use same code on windows machine.

 <urlopen error Tunnel connection failed: 407 Proxy Authentication Required ( Forefront 

TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )>

任何帮助将不胜感激。

推荐答案

Forefront TMG requires authorization to fulfill the request

看起来您的机器已配置(需要?)通过代理服务器路由出站流量(在这种情况下为Microsoft TMG)。当用户尝试使用您的应用程序进行身份验证时,Django正在尝试连接到其他服务进行验证,但由于该代理配置,该服务无法访问该服务。

It looks like your machine is configured (required?) to route outbound traffic through a proxy server (Microsoft's TMG, in this case). When a user tries to authenticate with your app, Django is trying to connect to another service to verify them, but it can't reach that service, because of the proxy configuration.

由于调用 urlopen 的代码可能在django-social-auth中,您可能不想直接修改以使用代理。您可以尝试设置 http_proxy 环境变量(请参阅此答案 for详细信息)使所有 urllib请求通过代理),或禁用您的Web服务器的代理身份验证。

Since the code that calls urlopen is probably within django-social-auth, you may not want to modify that directly to use the proxy. You can try setting an http_proxy environment variable (see this answer for details) to make all urllib requests go through the proxy), or disable proxy authentication for your web server.

这篇关于407代理验证需要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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