Documentation
¶
Index ¶
Constants ¶
View Source
const ( ClientID = "e6506150369268abae3ed46152687201" MaxFetchTokenAttempts = 120 // two minutes assuming interval is one second TokenInterval = 1 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func FetchToken ¶
func FetchToken( client resources.UnauthenticatedClient, deviceCode string, baseURI string, interval time.Duration, maxAttempts int, ) (string, error)
FetchToken attempts to get an access token. It will continue to try while the user logs in to verify their request. If the user denies the request or does nothing long enough for this call to time out, we do not return an access token.
func GetDeviceName ¶
func GetDeviceName() string
Types ¶
type DeviceAuthorization ¶
type DeviceAuthorization struct {
DeviceCode string `json:"deviceCode"`
ExpiresIn int `json:"expiresIn"`
UserCode string `json:"userCode"`
VerificationURI string `json:"verificationUri"`
}
func FetchDeviceAuthorization ¶
func FetchDeviceAuthorization( client resources.UnauthenticatedClient, clientID string, deviceName string, baseURI string, ) (DeviceAuthorization, error)
FetchDeviceAuthorization makes a request to create a device authorization that will later be used to set a local access token if the user grants access.
type DeviceAuthorizationToken ¶
type DeviceAuthorizationToken struct {
AccessToken string `json:"accessToken"`
}
Click to show internal directories.
Click to hide internal directories.