国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

.Net Core Jwt鑒權(quán)授權(quán)

這篇具有很好參考價值的文章主要介紹了.Net Core Jwt鑒權(quán)授權(quán)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

目錄
  • 簡介
  • 基于.Net Core 驗證方式
  • Jwt獲取Token
    • 引入三方包
    • 生成Token
    • UserInfo
    • JwtConfig
    • WebApi測試(獲取Token)
      • Program.cs
      • appsetting.json
      • Controller
  • .Net Core 驗證(webApi)
    • Progarm.cs
    • Contorller
  • .Net Core 授權(quán)
    • 簡介
    • Program.cs
    • JwtAuthorization.cs
      • 注意
      • Autofac 注冊授權(quán)服務(wù)
    • Controller
      • 注意
  • jwt觸發(fā)委托

簡介

  • Jwt分為三段 通過遠點分割
  1. header => 描述這個token加密方式
  2. PlayLoad => 有效載荷,用戶信息+自定義Claims信息Verify
  3. Signature => 簽名, (頭部信息base64處理,有效載荷base64處理) + 密鑰
  • 示例 :
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJFeHRlbmRlZDEiOiLml6Dkv6Hmga8iLCJFeHRlbmRlZDIiOiIiLCJFeHRlbmRlZDMiOiIiLCJFeHRlbmRlZDQiOiIiLCJFeHRlbmRlZDUiOiIiLCIxIjoi57O757uf566h55CG5ZGYIiwiMiI6IueUqOaIt-euoeeQhuWRmCIsImV4cCI6MTY4ODkwMTA2NiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDg4IiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdDo1MDg4In0.7J1J7yWj4ELHJZIwLKnT4RgcMu3rGAX5ACBFfCS0LWM

基于.Net Core 驗證方式

  1. 生成jwtToken
  2. 標(biāo)記[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
  3. 驗證 Issuer
  4. 驗證 Audience
  5. 驗證 SecurityKey
  6. 驗證自定義驗證
  7. 驗證完成可以正常訪問接口

驗證的那幾步順序可以直接在自定義驗證中驗證

Jwt獲取Token

引入三方包

<ItemGroup>
    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.31.0" />
    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.31.0" />
</ItemGroup>

生成Token


using Microsoft.IdentityModel.Tokens;
using Programming.DotNetCore.Function.Entity.Jwt;
using Programming.DotNetCore.Function.Interface.PasswordService;
using Programming.DotNetCore.Function.Password.Entity;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;

namespace Programming.DotNetCore.Function.Password
{
    public class JwtServices : IPassWordService
    {
        public string GetToken(UserInfo user,JwtConfig jwtConfig)
        {
            List<Claim> claims = new List<Claim>
            {
                new Claim(ClaimTypes.Name, user.UserName ?? ""),
                new Claim("Extended1", user.Extended1 ?? ""),
                new Claim("Extended2", user.Extended2 ?? ""),
                new Claim("Extended3", user.Extended3 ?? ""),
                new Claim("Extended4", user.Extended4 ?? ""),
                new Claim("Extended5", user.Extended5 ?? ""),
            };
            if (user.Role is not null)
            {
                foreach (var item in user.Role)
                {
                    claims.Add(new Claim(item.Id.ToString(), item.Role));
                }
            }
            if(jwtConfig.SecurityKey == null)
            {
                throw new Exception("JwtConfig.SecurityKey 不能為空");
            }
            SymmetricSecurityKey key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtConfig.SecurityKey));
            SigningCredentials creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
            JwtSecurityToken token = new JwtSecurityToken(
                issuer:jwtConfig.Issuer,
                audience:jwtConfig.Audience,
                claims:claims,
                expires: DateTime.UtcNow.AddMinutes(jwtConfig.ExpiresMinutes),
                signingCredentials:creds
            );
            string resultToken = new JwtSecurityTokenHandler().WriteToken(token);
            return resultToken;
        }
    }
}

UserInfo

namespace Programming.DotNetCore.Function.Password.Entity
{
    public class UserInfo
    {
        public string? UserName { get; set; }
        public List<RoleInfo>? Role { get; set; }
        public string? Extended1 { get; set; }
        public string? Extended2 { get; set; }
        public string? Extended3 { get; set; }
        public string? Extended4 { get; set; }
        public string? Extended5 { get; set; }
    }
}

JwtConfig

namespace Programming.DotNetCore.Function.Entity.Jwt
{
    public class JwtConfig
    {
        public string? Audience { get; set; }
        public string? Issuer { get; set; }
        public string? SecurityKey { get; set; }
        public int ExpiresMinutes { get; set; }
    }
}

WebApi測試(獲取Token)

Program.cs

//讀取Jwt配置
builder.Services.Configure<JwtConfig>(builder.Configuration.GetSection("JwtTokenOptions"));

appsetting.json

{
  "JwtTokenOptions": {
    "Issuer": "http://localhost:5088",
    "Audience": "http://localhost:5088",
    "SecurityKey": "kq4DY5N1eFJhscOkI7Zp4Nd0WNy9d9AEsN6Yjgdv9OxLyol66tzGBKT_7vwolN7GZ8EDwqJBwccjDJfb81ws5s3sbbP5wUzQ3-PcTSsD-Rueiu2rsOUZwg_NR3RBCwmtouV-832YV2trCjNTawLB1z0LMukWGFNaAJVZ8WdQcrYn6a0ko5oVhZqaHBgsCLEGiqPtoFsiCcrJTz1IvXHk9_cDSr2hwEmSl18GlkOtgCHFH8aidYth3aQHRHuClTi6Y9mYRJtqqK-FNQYq4ZP23DSGZGFejJFTnM9YMpppuTMLklhSGySwX8rfjZ_0L5ac18nHaykTaiC2fvH00W42qQ"
  }
}

Controller

using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Programming.DotNetCore.Function.Entity.Jwt;
using Programming.DotNetCore.Function.Interface.PasswordService;
using Programming.DotNetCore.Function.Password.Entity;

namespace Cnpc.Com.Ioc.WebApp.Controllers
{
    [Route("api/[controller]/[Action]")]
    [ApiController]
    public class TestJwtController : ControllerBase
    {
        IPassWordService _passWordService;
        JwtConfig _jwtconfig;

        public TestJwtController(IPassWordService passWordService,IOptions<JwtConfig> jwtconfig) 
        {
            _passWordService = passWordService;
            _jwtconfig = jwtconfig.Value;
        }

        [HttpGet]
        public IActionResult Login(string userName,string passWord)
        {
            string token = _passWordService.GetToken(new()
            {
                UserName = userName,
                Extended1 = "無信息",
                Role = new List<RoleInfo>() 
                { 
                    new RoleInfo() { Id = "1",Role="系統(tǒng)管理員"} ,
                    new RoleInfo() { Id = "2",Role="用戶管理員"} ,
                }
            }, new()
            {
                Audience = _jwtconfig.Audience,
                Issuer= _jwtconfig.Issuer,
                SecurityKey= _jwtconfig.SecurityKey,
                ExpiresMinutes = 5,
            });

            return new JsonResult(new { token = token }); 
        }
    }
}

.Net Core 驗證(webApi)

Progarm.cs

添加JWT驗證

builder.Services.AddAuthentication(options =>
{
    options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
}).AddJwtBearer(options =>
{
    options.TokenValidationParameters = new TokenValidationParameters()
    {
        ValidateIssuer = true,
        ValidIssuer = jwtConfig.Issuer, //發(fā)行人
        ValidateAudience = true,
        ValidAudience = jwtConfig.Audience,//訂閱人
        ValidateIssuerSigningKey = true,
        //對稱加密密鑰
        IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtConfig.SecurityKey!)),
        ValidateLifetime = true, //驗證失效時間
        ClockSkew = TimeSpan.FromSeconds(30), //過期時間容錯值
        RequireExpirationTime = true,
        AudienceValidator = (audiences, securityToken, validationParameters) =>
        {
            return true;
        },
        LifetimeValidator = (notBefore,expires,  securityToken, validationParameters) =>
        {
            return true;
        }
    };
});

app.UseAuthentication();

讀取配置文件

JwtConfig jwtConfig = new JwtConfig();
builder.Configuration.Bind("JwtTokenOptions", jwtConfig);

添加Swagger支持,api右上角可以寫Token

builder.Services.AddSwaggerGen(c =>
{
    //添加Jwt驗證設(shè)置,添加請求頭信息
    c.AddSecurityRequirement(new OpenApiSecurityRequirement
    {
        {
            new OpenApiSecurityScheme
            {
                Reference = new OpenApiReference
                {
                    Id = "Bearer",
                    Type = ReferenceType.SecurityScheme
                }
            },
            new List<string>()
        }
    });

    //放置接口Auth授權(quán)按鈕
    c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
    {
        Description = "Value Bearer {token}",
        Name = "Authorization",//jwt默認(rèn)的參數(shù)名稱
        In = ParameterLocation.Header,//jwt默認(rèn)存放Authorization信息的位置(請求頭中)
        Type = SecuritySchemeType.ApiKey
    });
}); ;

Contorller

using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Programming.DotNetCore.Function.Entity.Jwt;
using Programming.DotNetCore.Function.Interface.PasswordService;
using Programming.DotNetCore.Function.Password.Entity;

namespace Cnpc.Com.Ioc.WebApp.Controllers
{
    [Route("api/[controller]/[Action]")]
    [ApiController]
    public class TestJwtController : ControllerBase
    {
        [HttpGet]
        [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
        public IActionResult TestApi()
        {
            //獲取用戶Claim信息
            var user = HttpContext.User.Claims.Select(it => new { it.Type,it.Value});
            return new JsonResult(user);
        }
    }
}

.Net Core 授權(quán)

簡介

可以在數(shù)據(jù)庫中進一步驗證訪問接口的權(quán)限

Program.cs

//jwt 授權(quán)
builder.Services.AddAuthorization(options =>
{
    options.AddPolicy("JwtPolicy", policy =>
    {
        //jwt 授權(quán)
        policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
        //這里為自定義授權(quán)指定一下類
        .AddRequirements(new UserRoleRequirement(JwtBearerDefaults.AuthenticationScheme)); 
    });
});

app.UseAuthorization();

JwtAuthorization.cs

注意

驗證中涉及到 IUserServices 和 JwtAuthorization, 需要在ioc容器中注冊一下,我這里使用的是Autofac注冊,如果使用系統(tǒng)自帶的注冊可以這么寫:

  • builder.Services.AddTransient<IUserServices, UserServices>();
  • builder.Services.AddTransient<IAuthorizationHandler, JwtAuthorization>();

Autofac 注冊授權(quán)服務(wù)

using Autofac;
using Autofac.Extras.DynamicProxy;
using Castle.DynamicProxy;
using Cnpc.Com.Ioc.Bll;
using Cnpc.Com.Ioc.Dal;
using Cnpc.Com.Ioc.IBll;
using Cnpc.Com.Ioc.IDal;
using Cnpc.Com.Ioc.Tools;
using Cnpc.Com.Ioc.WebApp.Authorization;
using Cnpc.Com.Ioc.WebApp.Filter.ActionFilter;
using Microsoft.AspNetCore.Authorization;
using Programming.DotNetCore.Function.Interface.PasswordService;
using Programming.DotNetCore.Function.Password;

namespace WepApiTest.Autofac
{
    public class AutofacConfig : Module
    {

        protected override void Load(ContainerBuilder builder)
        {
            //ioc
            builder.RegisterType<JwtAuthorization>().As<IAuthorizationHandler>();
            builder.RegisterType<UserServices>().As<IUserServices>();
        }
    }
}
using Cnpc.Com.Ioc.IBll;
using Microsoft.AspNetCore.Authorization;
using System.Security.Claims;

namespace Cnpc.Com.Ioc.WebApp.Authorization
{
    public class UserRoleRequirement : IAuthorizationRequirement
    {
        public string AuthenticateScheme;
        public UserRoleRequirement(string authenticateScheme)
        {
            AuthenticateScheme = authenticateScheme;
        }
    }
    public class JwtAuthorization : AuthorizationHandler<UserRoleRequirement>
    {
        IUserServices userSercices;
        public JwtAuthorization(IUserServices userSercices)
        {
            this.userSercices = userSercices;
        }
        protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, UserRoleRequirement requirement)
        {
            string? userName = context.User.FindFirst(it => it.Type == ClaimTypes.Name)?.Value;
            if (userSercices.IsAdmin(userName!))
            {
                context.Succeed(requirement);
            }
            else
            {
                context.Fail();
            }
            return Task.CompletedTask;
        }
    }
}

Controller

注意

唯一需要修改的地方就是這里, 指定Policy 為 Program.cs 中設(shè)置授權(quán)方案名稱文章來源地址http://www.zghlxwxcb.cn/news/detail-538362.html

  • [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme,Policy = "JwtPolicy")]
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Programming.DotNetCore.Function.Entity.Jwt;
using Programming.DotNetCore.Function.Interface.PasswordService;
using Programming.DotNetCore.Function.Password.Entity;

namespace Cnpc.Com.Ioc.WebApp.Controllers
{
    [Route("api/[controller]/[Action]")]
    [ApiController]
    public class TestJwtController : ControllerBase
    {
        [HttpGet]
        [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme,Policy = "JwtPolicy")]
        public IActionResult TestApi()
        {
            var user = HttpContext.User.Claims.Select(it => new { it.Type,it.Value});
            return new JsonResult(user);
        }
    }
}

jwt觸發(fā)委托

 builder.Services.AddAuthentication(options =>
            {
                options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
            }).AddJwtBearer(options =>
            {
                options.TokenValidationParameters = new TokenValidationParameters()
                {
                    ValidateIssuer = true,
                    ValidIssuer = jwtConfig.Issuer, //發(fā)行人
                    ValidateAudience = true,
                    ValidAudience = jwtConfig.Audience,//訂閱人
                    ValidateIssuerSigningKey = true,
                    //對稱加密密鑰
                    IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtConfig.SecurityKey!)),
                    ValidateLifetime = true, //驗證失效時間
                    ClockSkew = TimeSpan.FromSeconds(30), //過期時間容錯值
                    RequireExpirationTime = true,
                    AudienceValidator = (audiences, securityToken, validationParameters) =>
                    {
                        return true;
                    },
                    LifetimeValidator = (notBefore,expires,  securityToken, validationParameters) =>
                    {
                        return true;
                    }
                };

                options.Events = new JwtBearerEvents() 
                {
                    //身份驗證失敗出發(fā)
                    OnAuthenticationFailed = AuthenticationFailedContext =>
                    {
                        return Task.CompletedTask;
                    },
                    //授權(quán)失敗觸發(fā)
                    OnForbidden = ForbiddenContext =>
                    {
                        return Task.CompletedTask;
                    },
                    //請求時候觸發(fā)
                    OnMessageReceived = MessageReceivedContext =>
                    {
                        return Task.CompletedTask;
                    },
                    //Token驗證成功觸發(fā)
                    OnTokenValidated = TokenValidatedContext =>
                    {
                        return Task.CompletedTask;
                    },
                    //沒有token,授權(quán)Handler處理失敗觸發(fā)
                    OnChallenge = JwtBearerChallengeContext =>
                    {
                        return Task.CompletedTask;
                    }
                };
            });

到了這里,關(guān)于.Net Core Jwt鑒權(quán)授權(quán)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • ASP.NET Core 鑒權(quán)授權(quán)三(添加自定義授權(quán)策略)

    ASP.NET Core 鑒權(quán)授權(quán)三(添加自定義授權(quán)策略)

    此處鑒權(quán)給的值是6,授權(quán)用的1,嘗試訪問 基于策略的授權(quán)中有一個很重要的概念是Requirements,每一個Requirement都代表一個授權(quán)條件。 Requirement需要繼承接口IAuthorizationRequirement。 已經(jīng)內(nèi)置了一些常用的實現(xiàn): AssertionRequirement :使用最原始的斷言形式來聲明授權(quán)策略。 DenyAn

    2024年02月03日
    瀏覽(22)
  • ASP.NET Core 鑒權(quán)授權(quán)一(簡單的Cookie)

    簡單的理解:鑒權(quán)衡量你能不能進一道門,授權(quán)是你進門了可以干什么

    2024年02月03日
    瀏覽(21)
  • ASP.NET Core 鑒權(quán)授權(quán)二(自定義token)

    首先自定義一個類TokenAuthenticationHandler,然后需要繼承IAuthenticationHandler接口 具體代碼: 后續(xù)需要鑒權(quán)的接口,在請求上都需要加上Authorization參數(shù) Claim:相當(dāng)于一個身份單元,存儲著鍵值信息 ClaimsIdentity:身份證,身份單元的集合(可以理解為身份證上有多個身份單元) Clai

    2024年02月03日
    瀏覽(22)
  • ASP.NET Core MVC 從入門到精通之鑒權(quán)授權(quán)基礎(chǔ)

    ASP.NET Core MVC 從入門到精通之鑒權(quán)授權(quán)基礎(chǔ)

    隨著技術(shù)的發(fā)展,ASP.NET Core MVC也推出了好長時間,經(jīng)過不斷的版本更新迭代,已經(jīng)越來越完善,本系列文章主要講解ASP.NET Core MVC開發(fā)B/S系統(tǒng)過程中所涉及到的相關(guān)內(nèi)容,適用于初學(xué)者,在校畢業(yè)生,或其他想從事ASP.NET Core MVC 系統(tǒng)開發(fā)的人員。 經(jīng)過前幾篇文章的講解,初步

    2024年02月08日
    瀏覽(17)
  • 如何在.net6webapi中配置Jwt實現(xiàn)鑒權(quán)驗證

    如何在.net6webapi中配置Jwt實現(xiàn)鑒權(quán)驗證

    jwt是一種用于身份驗證的開放標(biāo)準(zhǔn),他可以在網(wǎng)絡(luò)之間傳遞信息,jwt由三部分組成:頭部,載荷,簽名。頭部包含了令牌的類型和加密算法,載荷包含了用戶的信息,簽名則是對頭部和載荷的加密結(jié)果。 jwt鑒權(quán)驗證是指在用戶登錄成功后,服務(wù)器生成一個jwt令牌并返回給客戶

    2024年02月07日
    瀏覽(19)
  • ASP.NET Core高級之認(rèn)證與授權(quán)(二)--JWT認(rèn)證前后端完整實現(xiàn)

    ASP.NET Core高級之認(rèn)證與授權(quán)(二)--JWT認(rèn)證前后端完整實現(xiàn)

    了解JWT身份認(rèn)證的流程 了解基于JWT身份認(rèn)證和Session身份認(rèn)證的區(qū)別 學(xué)習(xí)如何在ASP.NET Core WebAPI項目中封裝JWT認(rèn)證功能 在上文ASP.NET Core高級之認(rèn)證與授權(quán)(一)–JWT入門-頒發(fā)、驗證令牌中演示了JWT認(rèn)證的一個入門案例,本文是一個基于JWT認(rèn)證的完整的前后端實現(xiàn)代碼案例。 JWT身

    2024年02月01日
    瀏覽(23)
  • ASP.NET Core使用JWT+標(biāo)識框架(identity)實現(xiàn)登錄驗證

    ASP.NET Core使用JWT+標(biāo)識框架(identity)實現(xiàn)登錄驗證

    最近閱讀了《ASP.NET Core 技術(shù)內(nèi)幕與項目實戰(zhàn)——基于DDD與前后端分離》(作者楊中科)的第八章,對于Core入門的我來說體會頗深,整理相關(guān)筆記。 JWT:全稱“JSON web toke”,目前流行的跨域身份驗證解決方案; 標(biāo)識框架(identity):由ASP.NET Core提供的框架,它采用RBAC(role

    2024年02月11日
    瀏覽(25)
  • .NET CORE開源 DDD微服務(wù) 支持 多租戶 單點登錄 多級緩存、自動任務(wù)、分布式、日志、授權(quán)和鑒權(quán) 、網(wǎng)關(guān) 、注冊與發(fā)現(xiàn) 系統(tǒng)架構(gòu) docker部署

    .NET CORE開源 DDD微服務(wù) 支持 多租戶 單點登錄 多級緩存、自動任務(wù)、分布式、日志、授權(quán)和鑒權(quán) 、網(wǎng)關(guān) 、注冊與發(fā)現(xiàn) 系統(tǒng)架構(gòu) docker部署

    源代碼地址https://github.com/junkai-li/NetCoreKevin 基于NET6搭建跨平臺DDD思想WebApi架構(gòu)、IDS4單點登錄、多緩存、自動任務(wù)、分布式、多租戶、日志、授權(quán)和鑒權(quán)、CAP、SignalR、 docker部署? 如需簡約項目可直接去除項目引用 解耦設(shè)計都可以單獨引用 架構(gòu)默認(rèn)全部引用并啟動 項目啟動時

    2023年04月24日
    瀏覽(20)
  • AspNetCore 成長雜記(一):JWT授權(quán)鑒權(quán)之生成JWT(其一)

    最近不知怎么的,自從學(xué)了WebAPI(為什么是這個,而不是MVC,還不是因為MVC的Razor語法比較難學(xué),生態(tài)不如現(xiàn)有的Vue等框架,webapi很好的結(jié)合了前端生態(tài))以后,使用別人的組件一帆風(fēng)順,但是不知其意,突然很想自己實現(xiàn)一個基于的JWT認(rèn)證服務(wù),來好好了解一下這個內(nèi)容。 自

    2023年04月19日
    瀏覽(16)
  • AspNetCore 成長雜記(一):JWT授權(quán)鑒權(quán)之生成JWT(其二)

    前面說了用第三方類庫生成JWT的故事,給我?guī)砹撕艽蟮姆奖?,并且我也承諾要寫一篇用常規(guī)方法生成JWT的文章( 一般都是用微軟官方的類庫 ),因此才有了這篇文章。 另外,在前面的文章中,我要糾正一下一些錯誤JWT的整個結(jié)構(gòu)決定了JWT只能作為臨時的授權(quán)認(rèn)證解決方案,

    2023年04月26日
    瀏覽(16)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包