-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmodel.go
35 lines (31 loc) · 1.23 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package oauth
import (
"time"
)
// TokenResponse is the authorization server response
type TokenResponse struct {
Token string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"` // bearer
ExperesIn int64 `json:"expires_in"` // secs
Properties map[string]string `json:"properties"`
}
// Token structure generated by the authorization server
type Token struct {
Id string `json:"id_token"`
CreationDate time.Time `json:"date"`
ExperesIn time.Duration `json:"expires_in"` // secs
Credential string `json:"credential"`
Scope string `json:"scope"`
Claims map[string]string `json:"claims"`
TokenType string `json:"type"` // "U" for user, "C" for client
}
// RefreshToken structure included in the authorization server response
type RefreshToken struct {
CreationDate time.Time `json:"date"`
TokenId string `json:"id_token"`
RefreshTokenId string `json:"id_refresh_token"`
Credential string `json:"credential"`
TokenType string `json:"type"` // "U" for user, "C" for client
Scope string `json:"scope"`
}