引用类型'AuthenticationOptions'声明它在'Microsoft.AspNetCore.Authentication'中定义,但无法找到

问题描述:

我试图运行'UseIdentityServerAuthentication'并传入IdentityServerAuthenticationOptions并在Asp.Net Core中获取此错误2.引用类型'AuthenticationOptions'声明它在'Microsoft.AspNetCore.Authentication'中定义,但无法找到

在网上看起来这是在Asp.Net Core 2 Preview 2的路线图上,我运行了它的最新版本,所以我认为它现在可用。

我想你想要的是IdentityOptions,可在https://github.com/aspnet/Identity/blob/eb3ff7fc32dbfff65a1ba6dfdca16487e0f6fc41/src/Microsoft.Extensions.Identity.Core/IdentityOptions.cs。它应该在Microsoft.AspNetCore.Identity Nuget包中可用。

+0

实际上,功能丰富的UseidentityServerAuthentication接受了identityServerAuthenticationOptions类。除非我误解你的意思? – tweetypi

+0

我的错!所以,你正在使用IdentityServer4,这从你的描述中并不明显!所以,你想要的包是IdentityServer4,它有这种类型,请参阅https://github.com/IdentityServer/IdentityServer4.AccessTokenValidation/blob/dev/src/IdentityServer4.AccessTokenValidation/IdentityServerAuthenticationOptions.cs。 –

+0

不幸的是,似乎没有在asp.net核心2中可用... ... – tweetypi