带有 Windows Live 的 OAuth2 返回全部"HTTP request forbidden with client authentication scheme 'Anonymous'



我不想在我的应用程序中使用windows live的loggin功能。因此,我定义了一个重定向URL,创建了一个应用程序ID,并从中获得了应用程序机密

https://account.live.com/developers/applications/create?tou=1

但每次我试图用我的windows实时帐户登录我的应用程序时,我都会收到以下错误消息:

客户端身份验证方案禁止HTTP请求"匿名"。

当我查看我的应用程序摘要时,它看起来像:

...
Mobile Client-App or Desctopclient-App:
No
JWT-output restriction:
Yes
secure redirection:
active
...

我认为"安全重定向"是问题所在。但不可能更改此值。有人知道如何解决这个问题吗。

我使用的是谷歌应用程序引擎和python中的authomatic框架。类似这样的东西:

https://github.com/peterhudec/authomatic/tree/master/examples/gae/simple

================这里有一些额外信息=============

当我点击应用程序上的链接登录windows时,我会重定向到:

https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1411214956&服务器=6.2.6289.0&wp=MBI_SL&wreply=https:%2F%2Fauth.live.com%2Authorize%3Scope%3Dwl.basic.252Cwl.emails%252Cwl.photes%26state%3D93df705504af6a4cf653a4d061%26redirect_uri%3Dhttp%253A%252F%252myLoginTestApp.appspot.com%252Flogin%252Fwl%26response_type%3Dcode%26client_id%3D000000000…….26auth_redirect%3True&lc=1031&id=276649&popupui=1

(其中……是我的应用程序ID)如果我使用用户名和密码登录,则以错误结束。

这个应用程序的谷歌开发者控制台的日志如下所示:

  1. authomatic:WindowsLive:正在启动OAuth 2.0授权过程
  2. authomatic:WindowsLive:正在将用户重定向到https://oauth.live.com/authorize?scope=wl.basic%2Cwl.emails%2Cwl.photos&state=93df705504af6a4cf653a4d061&redirect_uri=http%3A%2F%2FmyLoginTestApp.appspot.com%2Flogin%2wl&response_type=代码&client_id=00000000
  3. /登录/wl?error=server_error&errordescription=%20HTTP%20请求%20被%20禁止%20与%20客户端%20身份验证%20方案%20"匿名"&state=93df7055aaaf6a4cf653a4d061 someIp-【2014年9月20日:05:20:07-0700】"获取/登录/wl?error=server_error&errordescription=%20HTTP%20请求%20被%20禁止%20与%20客户端%20身份验证%20方案%20\‘匿名者’。&state=93DF7055aaf6a4cf 653a4d061 HTTP/1.1"200 331-"Mozilla/5.0(Windows NT 6.1;rv:32.0)Gecko/20100101 Firefox/32.0"myLoginTestApp.app spot.com"ms=60 cpu_ms=0cpm_usd=0.000037实例=。。。someInstanceId。。。app_engine_release=1.9.11
  4. authomatic:WindowsLive:报告的已抑制异常:FailureError(u"HTTP请求被客户端身份验证方案"匿名"禁止。",)

这是因为Windows Live更改了OAuth 2.0端点。http://msdn.microsoft.com/en-us/library/hh243647.aspx

我可以从日志中看到,您正在使用Authomatic,我是它的维护者。新的端点在Authomatic 0.0.9中固定。

最新更新