ASP.NET MVC 5 - Microsoft Account OAuth2 sign-on stop to work after update the Microsoft.Owin packages from v3.0.1 to v3.1.0

0 投票
最新提问 用户: 匿名

I have updated the following Nuget packages from v3.0.1 to v3.1.0:

  • Microsoft.Owin
  • Microsoft.Owin.Host.SystemWeb
  • Microsoft.Owin.Security
  • Microsoft.Owin.Security.Cookies
  • Microsoft.Owin.Security.Google
  • Microsoft.Owin.Security.MicrosoftAccount

And after these updates the following issue is displayed when I try to authenticate using a Microsoft Account:

Correlation ID: 1a411cc0-446c-42bb-8659-cdd7dd9e6199

AADSTS70011: The provided value for the input parameter 'scope' is not valid. The scope wl.emails is not valid.

Important notes:

  • This issue is only happening when I try to use a Microsoft Account for authenticating. There is no issue when I use a Google account for authenticating it
  • When I do the downgrade for the v3.0.1 the Microsoft Account authentication back to work again

Does anyone know if something has changed in Microsoft authentication on Microsoft.Owin.Security.MicrosoftAccount v3.1.0 that I have to change in my source code?

Here are the Startup.Auth.cs from the System:

using Microsoft.Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.Google;
using Microsoft.Owin.Security.MicrosoftAccount;
using Owin;

namespace IRIS
    public partial class Startup
        private void ConfigureAuth(IAppBuilder app)
            var cookieAuthenticationOptions = new CookieAuthenticationOptions { ExpireTimeSpan = System.TimeSpan.FromMinutes(120), LoginPath = new PathString("/Account/Login") };
            app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions { ClientId = "<MyGoogleClientId>", ClientSecret = "<MyGoogleClientSecret>" });
            app.UseMicrosoftAccountAuthentication(new MicrosoftAccountAuthenticationOptions { ClientId = "<MyMicrosoftClientId>", ClientSecret = "<MyClientSecret>", Scope = { "wl.emails" } });

登录 或者 注册 后回答这个问题。

欢迎来到 Security Q&A ,有什么不懂的可以尽管在这里提问,你将会收到社区其他成员的回答。