-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconstant.go
More file actions
24 lines (21 loc) · 990 Bytes
/
constant.go
File metadata and controls
24 lines (21 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package oauth2
import "time"
const (
// contentTypeJSON JSON内容类型 / JSON content type for HTTP responses
contentTypeJSON = "application/json"
// AccessTokenExpire 访问令牌过期时间(1小时) / Access token expiration time (1 hour)
AccessTokenExpire = time.Second * 3600
// RefreshTokenExpire 刷新令牌过期时间(30分钟) / Refresh token expiration time (30 minutes)
RefreshTokenExpire = AccessTokenExpire / 2
// TokenTypeBearer Bearer令牌类型 / Bearer token type
TokenTypeBearer = "Bearer"
// ScopeRefreshToken 刷新令牌的scope / Scope for refresh token
ScopeRefreshToken = "refresh_token"
// DefaultJwtIssuer 默认JWT颁发者 / Default JWT issuer
DefaultJwtIssuer = "github.com/nilorg/oauth2"
// PKCE 相关常量 / PKCE related constants (RFC 7636)
// CodeChallengeMethodPlain 明文方法 / Plain method
CodeChallengeMethodPlain = "plain"
// CodeChallengeMethodS256 SHA256方法 / SHA256 method
CodeChallengeMethodS256 = "S256"
)