批量更新
This commit is contained in:
@@ -42,6 +42,10 @@ type Claims struct {
|
||||
Scope string `json:"scope,omitempty"`
|
||||
Amr string `json:"amr,omitempty"` // 认证方式:pwd/sms/otp/wx/...
|
||||
|
||||
// Events OIDC 事件声明,用于 Back-Channel Logout:
|
||||
// {"http://schemas.openid.net/event/backchannel-logout": {}}
|
||||
Events map[string]interface{} `json:"events,omitempty"`
|
||||
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
@@ -147,8 +151,9 @@ type TokenOptions struct {
|
||||
Amr string
|
||||
Subject string
|
||||
Audience []string
|
||||
Jti string // JWT ID,用于吊销(登出/踢下线)
|
||||
TTL time.Duration // 留空默认 30 分钟
|
||||
Jti string // JWT ID,用于吊销(登出/踢下线)
|
||||
Events map[string]interface{} // OIDC 事件声明(Back-Channel Logout 用)
|
||||
TTL time.Duration // 留空默认 30 分钟
|
||||
Kid string
|
||||
}
|
||||
|
||||
@@ -178,6 +183,7 @@ func SignToken(opt TokenOptions) (string, error) {
|
||||
Sid: opt.Sid,
|
||||
Scope: opt.Scope,
|
||||
Amr: opt.Amr,
|
||||
Events: opt.Events,
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ID: opt.Jti,
|
||||
Subject: opt.Subject,
|
||||
|
||||
Reference in New Issue
Block a user