我可以使用openiddict示例,但我想使用JWT。我知道我不能在JWT中使用OAuth,因为它们是两个不同的东西。合乎道理。
但是如果我想使用JWT,那么我需要安装一个持有者令牌中间件包。我相信,对于.net核心来说,它就是Microsoft.AspNetCore.Authentication.JwtBearer
但是我不能同时用openiddict安装那个包。我需要使用特定版本的JwtBearer才能使其工作吗?
当我尝试安装时,我得到的错误是
Unable to resolve 'OpenIddict (>= 1.0.0)' for '.NETCoreApp,Version=v1.1'.
Unable to resolve 'OpenIddict.Mvc (>= 1.0.0)' for '.NETCoreApp,Version=v1.1'.
Unable to resolve 'OpenIddict.EntityFrameworkCore (>= 1.0.0)' for '.NETCoreApp,Version=v1.1'.Openiddict包安装
<!-- OpenIdDict -->
<PackageReference Include="AspNet.Security.OAuth.Validation" Version="1.0.0-*" />
<PackageReference Include="OpenIddict" Version="1.0.0-*" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="1.0.0-*" />
<PackageReference Include="OpenIddict.Mvc" Version="1.0.0-*" />NuGet配置
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="aspnet-contrib" value="https://www.myget.org/F/aspnet-contrib/api/v3/index.json" />
</packageSources>
</configuration>发布于 2017-06-27 15:38:09
请尝试在包管理器控制台中运行此命令:
Install-Package OpenIddict -Version 1.0.0-beta2-0615 -Source https://www.myget.org/F/aspnet-contrib/api/v3/index.json
或
将此包源添加到Nuget包源:https://www.myget.org/F/aspnet-contrib/api/v3/index.json
https://stackoverflow.com/questions/44136961
复制相似问题