Info
Version: | 2.7.10 |
Author(s): | Jack |
Last Update: | Friday, November 8, 2024 |
.NET Fiddle: | Create the first Fiddle |
NuGet Url: | https://www.nuget.org/packages/JMS.Token.AspNetCore |
Install
Install-Package JMS.Token.AspNetCore
dotnet add package JMS.Token.AspNetCore
paket add JMS.Token.AspNetCore
JMS.Token.AspNetCore Download (Unzip the "nupkg" after downloading)
Dependencies
- JMS.Token(>= 1.0.0.7)
- Microsoft.AspNetCore.Authentication(>= 2.2.0)
- Microsoft.AspNetCore.Authentication.Abstractions(>= 2.2.0)
services.AddJmsTokenAspNetCore(new NetAddress("127.0.0.1", 9911),new string[]{"Authorization"});
app.UseAuthentication();
app.UseAuthorization();
如果通过验证,controller中通过下面代码获取token内容:
this.User.FindFirstValue("Content")
用依赖注入获取TokenClient实例,生成token.