代码拉取完成,页面将自动刷新
package jwt
import (
"github.com/golang-jwt/jwt/v5"
)
// Custom claims structure
type CustomClaims struct {
jwt.RegisteredClaims
BaseClaims
BufferTime int64 `json:"buffer_time,omitempty"` //
}
// if put user info to redis/cache, then we can use less props, more props can get from cache/db
// if didn't use cache, then we can add more props here
// more props means the jwt string will become large
type BaseClaims struct {
UserId string `json:"user_id"` //
Username string `json:"username"` //
Roles string `json:"roles,omitempty"` //
Groups string `json:"groups,omitempty"` //
TenantId string `json:"tenant_id,omitempty"` // our's
From uint8 `json:"from,omitempty"` // login from
UserIdInIdp string `json:"user_id_in_idp,omitempty"` // authing use sub as user id,
Idp string `json:"idp,omitempty"` //
Unionid string `json:"unionid,omitempty"` // only used for parsing third jwt string
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。