方法未在UseOpenIdConnectAuthentication中间件中找到
本文关键字:中间件 UseOpenIdConnectAuthentication 方法 | 更新日期: 2023-09-27 18:14:25
我用web命令运行我的web应用程序:"网络":"Microsoft.AspNet。托管—ASPNET_ENV开发—服务器microsoft . aspnet_server . weblistener—服务器。url http://localhost: 49102"这是控制台显示的错误:
系统。MissingMethodException: Method not found: 'Void Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValidator.set_RequireState(布尔).Microsoft.AspNet.Authentication.OpenIdConnect.OpenIdConnectOptions . .男星(S特林authenticationScheme)在Microsoft.AspNet.Builder.OpenIdConnectExtensions.UseOpenIdConnectAuthentic配置(IApplicationBuilder app, Action ' 1 configureOptions)
我尝试使用这段代码,但不工作:
app.UseOpenIdConnectAuthentication(options => { options.ProtocolValidator =new OpenIdConnectProtocolValidator { RequireStateValidation=false }; ...
刚刚在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不断化解