简体   繁体   English

使用Yahoo OAuth时出现“ access_denied”

[英]“access_denied” when using Yahoo OAuth

I have an ASP.NET MVC 5 application which was migrated to ASP.NET Identity and I am in the progress of implementing OAuth authentification. 我有一个ASP.NET MVC 5应用程序,该应用程序已迁移到ASP.NET Identity,并且正在实现OAuth身份验证。 Before the migration I was using Yahoo with OpenID which did work, but is no longer supported. 在迁移之前,我曾将Yahoo与OpenID结合使用,但确实可以使用,但不再受支持。
All common provider (Google, MS, Facebook, ...) are working fine, but I can't get Yahoo to work. 所有常见的提供程序(Google,MS,Facebook等)都可以正常工作,但是我无法让Yahoo正常工作。
I am using the THIS provider. 我正在使用提供程序。

When I do the authentication everything looks fine until it comes back to my page. 当我进行身份验证时,一切看起来很好,直到返回到我的页面为止。 There await AuthenticationManager.GetExternalLoginInfoAsync() returns null. await AuthenticationManager.GetExternalLoginInfoAsync()返回null。

I then checked the complete "request stack" and saw the following "request-flow": 然后,我检查了完整的“请求堆栈”,并看到了以下“请求流”:

  1. Post back to http://mydomain.net/Account/ExternalLogin 发回到http://mydomain.net/Account/ExternalLogin
  2. Response with header Location: https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=hwwvmgr 标头Location: https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=hwwvmgr响应Location: https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=hwwvmgr
  3. Loging in via Yahoo 通过Yahoo登录
  4. Request to https://api.login.yahoo.com/oauth/v2/request_auth 要求https://api.login.yahoo.com/oauth/v2/request_auth
  5. Response with header Location: http://mydomain.net/signin-yahoo?oauth_token=hwwvmgr&oauth_verifier=p2bppu 标头Location: http://mydomain.net/signin-yahoo?oauth_token=hwwvmgr&oauth_verifier=p2bppu响应Location: http://mydomain.net/signin-yahoo?oauth_token=hwwvmgr&oauth_verifier=p2bppu
  6. Request to that URL 请求该URL
  7. Response with header Location: /Account/ExternalLoginCallback?error=access_denied 标头Location: /Account/ExternalLoginCallback?error=access_denied

Does anybody have an idea why this could happen? 有人知道为什么会发生这种情况吗?

I executed this on a "real domain" which is verified at Yahoo. 我在Yahoo验证的“真实域”上执行了此操作。
The Configuration looks like the following: 该配置如下所示:

var options = new YahooAuthenticationOptions();
options.ConsumerKey = settings.ConsumerKey;
options.ConsumerSecret = settings.ConsumerSecret;
app.UseYahooAuthentication(options);

Found the problem: Was a bug in the provider. 发现了问题:是提供程序中的错误。 If you check the History here : 如果您在此处查看历史记录:

Version 1.5.1 - Fixed issue with Yahoo provider. 版本1.5.1-修复了Yahoo provider的问题。 Please see http://www.jerriepelser.com/blog/introducing-the-yahoo-linkedin-oauth-security-providers-for-owin for how to use the Yahoo provider correctly. 请参阅http://www.jerriepelser.com/blog/introducing-the-yahoo-linkedin-oauth-security-providers-for-owin,以了解如何正确使用Yahoo提供程序。 Take note of the requirements for testing on localhost. 注意在localhost上进行测试的要求。

I just updated the provider to version 1.6 (they just came out last week, so I had not updated yet) and it is working now. 我刚刚将提供程序更新为版本1.6(它们是上周才发布的,所以我还没有更新),它现在可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM