2021
06-13
06-13
asp.net core MVC之实现基于token的认证
安装Nuget包项目中添加包:dotnetaddpackageMicrosoft.AspNetCore.Authentication.JwtBearer添加认证配置Startup类中添加如下配置:publicvoidConfigureServices(IServiceCollectionservices){...services.AddAuthentication(defaultScheme:JwtBearerDefaults.AuthenticationScheme);}publicvoidConfigure(IApplicationBuilderapp,IWebHostEnvironmentenv){...app.UseAuthentication();app.UseAut...
继续阅读 >