.net 成功登录AzureAD后出现MissingMethodException

.net 成功登录AzureAD后出现MissingMethodException,.net,azure,asp.net-core,.net,Azure,Asp.net Core,我正在尝试实现AzureAD身份验证,但在成功登录后,我会继续进行验证 在…上https://localhost:5001/signin-oidc MissingMethodException:未找到方法: 'Microsoft.IdentityModel.Tokens.SecurityKey Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.FindKeyMatch(System.String, System.String,Micr

我正在尝试实现AzureAD身份验证,但在成功登录后,我会继续进行验证 在…上https://localhost:5001/signin-oidc

MissingMethodException:未找到方法: 'Microsoft.IdentityModel.Tokens.SecurityKey Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.FindKeyMatch(System.String, System.String,Microsoft.IdentityModel.Tokens.SecurityKey, System.Collections.Generic.IEnumerable'1')

在Startup类中

 services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
                .AddAzureAD(options => Configuration.Bind("AzureAd", options));

            services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
            {
                options.Authority = options.Authority + "/v2.0";
                options.TokenValidationParameters.ValidateIssuer = false;
            });

            services.AddAuthorization(options =>
            {
                options.AddPolicy("MyAdminGroup", policyBuilder => policyBuilder.RequireClaim("groups", "1204e97b-75fc-498c-a86f-3fc4d36ef4d4"));
            });
在门户上,我更改了重定向URL,以将我的.net核心应用程序端口与
https://localhost:5001

您的MSAL nuget版本是什么?您是否也在使用其他Microsoft.Identity*nugets?如果是,版本?我想看看是否有版本兼容性问题,因为错误肯定是由此引起的。@KrishnenduGhosh MSFT我看不出整个项目中有任何Microsoft.Identity.Client引用。这些参考资料有帮助吗?Microsoft.AspNetCore.Authentication.AzureAD.UI;Microsoft.AspNetCore.Authentication.OpenIdConnect;Microsoft.AspNetCore.Authentication;试图了解asp.net核心应用程序当前使用的身份验证库是什么。理想情况下,您应该只需要一个父nuget Microsoft.AspNetCore.Authentication.AzureAD.UI(它将自动安装具有正确版本的从属nuget)。或者您也可以查看Micrsoft.Identity.Web(预览中的currentl nuget),它大大简化了AAD集成…您的MSAL nuget版本是什么?您是否也在使用其他Microsoft.Identity*nugets?如果是,版本?我想看看是否有版本兼容性问题,因为错误肯定是由此引起的。@KrishnenduGhosh MSFT我看不出整个项目中有任何Microsoft.Identity.Client引用。这些参考资料有帮助吗?Microsoft.AspNetCore.Authentication.AzureAD.UI;Microsoft.AspNetCore.Authentication.OpenIdConnect;Microsoft.AspNetCore.Authentication;试图了解asp.net核心应用程序当前使用的身份验证库是什么。理想情况下,您应该只需要一个父nuget Microsoft.AspNetCore.Authentication.AzureAD.UI(它将自动安装具有正确版本的从属nuget)。或者您也可以查看Micrsoft.Identity.Web(预览中的currentl nuget),这大大简化了AAD集成。。。
"AzureAd": {
    "Instance": "https://login.microsoftonline.com/",
    "Domain": "mydomain.onmicrosoft.com",
    "TenantId": "a4ca2fb4-abad-1ac4-8997-74997a9afb11",
    "ClientId": "b180cc8d-fa37-44b9-af9c-1fa0c7859aad",
    "CallbackPath": "/signin-oidc"
  }