以IdentityServer4为例
从认证服务器获取公匙
从http://localhost:5000/.well-known/openid-configuration/jwks获取公匙,返回数据如下:
{
"keys":[
{
"kty":"RSA", // 使用RSA算法
"use":"sig", // 类型为签名
"kid":"03ece87289fe54eee377a1380b0e49a2", // 与token有关
"e":"AQAB", // RSA算法中的e,base64url(注意与base64的区别)
"n":"3JjRAiTwPOCDrWFcsHDovYDuBaqWuSSLxSp27Bc6rDnsepkw-yISVRlM4C-MwgL4wiDZnnQBv9-zZi8on0_L1L7UuuN5HFvvd01xApIWGdhJwQl2ijltwOKG8osxQQXtkDLOPOxhV-Fs5K9KQWW0AXdkPUXYulP3854MXmNWOqtC3fhMg78MUZAAKGrj67qk0tRdtxXIgF_Mqn5cMsEq8X7xWcbcPwWuc_NsfSxs43Y-p-7THMrv8vRzIQFUO27WGMZP9cTlXx0_OuhRaNnZUJoamp89-j-XMBfYzsCFyD_a3dBdUMvNtvgDq4IylA1oyT1F_J8xi4SPHwtNvnWxLQ", // RSA算法中的n,base64url(注意与base64的区别)
"al