【问题标题】:Method not found in UseOpenIdConnectAuthentication middleware在 UseOpenIdConnectAuthentication 中间件中找不到方法
【发布时间】:2015-09-24 08:43:45
【问题描述】:

我使用 web 命令运行我的 web 应用程序: "web": "Microsoft.AspNet.Hosting --ASPNET_ENV 开发 --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:49102" 这是控制台中显示的错误:

System.MissingMethodException:找不到方法:'无效 Microsoft.IdentityModel.P rotocols.OpenIdConnect.OpenIdConnectProtocolValidator.set_RequireState(Boolean)' . 在 Microsoft.AspNet.Authentication.OpenIdConnect.OpenIdConnectOptions..ctor(S 身份验证方案) 在 Microsoft.AspNet.Builder.OpenIdConnectExtensions.UseOpenIdConnectAuthentic ation(IApplicationBuilder app, Action`1 configureOptions)

我尝试使用此代码但没有成功:

app.UseOpenIdConnectAuthentication(options => { options.ProtocolValidator =new OpenIdConnectProtocolValidator { RequireStateValidation=false }; ...

【问题讨论】:

  • 能否分享一下project.json文件和你正在使用的DNX版本?
  • @VictorHurdugaci 我设置了一个实验here

标签: c# asp.net-core


【解决方案1】:

刚刚在 IdentityModel beta8 中进行了一些我们尚未在 OIDC beta8 中使用的重大更改。在此追踪:https://github.com/aspnet/Security/issues/493

将您的 IdentityModel 依赖项降级到 beta7,它应该可以工作,直到我们赶上。见https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNet.Authentication.OpenIdConnect/project.json#L11

【讨论】:

    猜你喜欢
    • 2021-04-19
    • 1970-01-01
    • 2015-03-21
    • 2019-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-26
    • 1970-01-01
    相关资源
    最近更新 更多