-
Notifications
You must be signed in to change notification settings - Fork 3
/
response.go
18 lines (15 loc) · 1.42 KB
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (c) 2013 Jason McVetta. This is Free Software, released under the
// terms of the GPL v3. See http://www.gnu.org/copyleft/gpl.html for details.
// Resist intellectual serfdom - the ownership of ideas is akin to slavery.
package o2pro
/*
Implementation of https://tools.ietf.org/html/rfc6749#section-5.1
*/
// A TokenResponse is sent on a successful authorization request.
type TokenResponse struct {
AccessToken string `json:"access_token"` // REQUIRED. The access token issued by the authorization server.
TokenType string `json:"token_type"` // REQUIRED. The type of the token issued as described in Section 7.1. Value is case insensitive.
ExpiresIn int `json:"expires_in,omitempty"` // RECOMMENDED. The lifetime in seconds of the access token. For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated. If omitted, the authorization server SHOULD provide the expiration time via other means or document the default value.
RefreshToken string `json:"refresh_token,omitempty"` // OPTIONAL. The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in Section 6.
Scope string `json:"scope"` // OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED. The scope of the access token as described by Section 3.3.
}