-
Notifications
You must be signed in to change notification settings - Fork 7
/
oauth.go
36 lines (31 loc) · 1.12 KB
/
oauth.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
36
package v1payload
//GetOAuthCredentialsInput is input for getting oauth credentials
type GetOAuthCredentialsInput struct {
Code string `url:"code"`
ClientID string `url:"client_id"`
RedirectURI string `url:"redirect_uri"`
GrantType string `url:"grant_type"`
}
//GetOAuthCredentialsOutput is output when getting oauth credentials
type GetOAuthCredentialsOutput struct {
OAuthCredentials
}
//RefreshOAuthCredentialsInput is input for refreshing oauth credentials
type RefreshOAuthCredentialsInput struct {
RefreshToken string `url:"refresh_token"`
ClientID string `url:"client_id"`
GrantType string `url:"grant_type"`
}
//RefreshOAuthCredentialsOutput is output when refreshing oauth credentials
type RefreshOAuthCredentialsOutput struct {
OAuthCredentials
}
// OAuthCredentials represents the OAuth access tokens
type OAuthCredentials struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresIn int `json:"expires_in"`
Scope string `json:"scope,omitempty"`
TokenType string `json:"token_type,omitempty"`
IDToken string `json:"id_token"`
}