Documentation ¶
Overview ¶
JWT标准中注册的声明 (建议但不强制使用) :
iss: jwt签发者 sub: jwt所面向的用户 aud: 接收jwt的一方 exp: jwt的过期时间,这个过期时间必须要大于签发时间 nbf: 定义在什么时间之前,该jwt都是不可用的. iat: jwt的签发时间 jti: jwt的唯一身份标识,主要用来作为一次性token,从而回避重放攻击。
Index ¶
- type Jwt
- type JwtClaims
- func (c *JwtClaims) Get(key string) interface{}
- func (c *JwtClaims) GetFloat32(key string) float32
- func (c *JwtClaims) GetFloat64(key string) float64
- func (c *JwtClaims) GetInt(key string) int
- func (c *JwtClaims) GetInt64(key string) int64
- func (c *JwtClaims) GetStr(key string) string
- func (c *JwtClaims) HasRefresh() bool
- type JwtOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Jwt ¶
type JwtClaims ¶
type JwtClaims struct {
// contains filtered or unexported fields
}
func (*JwtClaims) GetFloat32 ¶
func (*JwtClaims) GetFloat64 ¶
func (*JwtClaims) HasRefresh ¶
type JwtOption ¶
type JwtOption func(*Jwt)
func JwtRefresh ¶
func JwtSecretKey ¶
func JwtSigningMethod ¶
func JwtSigningMethod(method jwt.SigningMethod) JwtOption
Click to show internal directories.
Click to hide internal directories.