Esempio n. 1
0
func (v *v1Client) ExchangeToken(code, verifier, realm string) error {
	cred, _, err := v.data.Client.RequestToken(nil, v.data.TemporaryCredentials, verifier)

	if err != nil {
		return err
	}

	v.data.PermanentCredentials = cred
	v.data.Realm = realm

	return aggregations.WriteOAuthToken(v.name, v.data)
}
Esempio n. 2
0
func (v *v1Client) GetAuthorizationURL() (string, error) {
	cred, err := v.data.Client.RequestTemporaryCredentials(nil, TelemetryOAuthClientResponseURL, nil)

	if err != nil {
		return "", err
	}

	v.data.TemporaryCredentials = cred

	err = aggregations.WriteOAuthToken(v.name, v.data)

	return v.data.Client.AuthorizationURL(cred, nil), err
}