rsapi/auth.go
func (a *ssAuthenticator) CanAuthenticate(host string) error {
	url := fmt.Sprintf("api/catalog/accounts/%d/user_preferences", a.accountID)
	req, err := http.NewRequest("GET", buildURL(host, url), nil)
	if err != nil {
		return err
	}
	req.Header.Set("X-Api-Version", "1.0")
	if err := a.Sign(req); err != nil {
		return err
	}
	resp, err := a.client.DoHidden(req)
	if err != nil {
		return err
	}
	if resp.StatusCode != 200 {
		var body string
		if b, err := ioutil.ReadAll(resp.Body); err != nil {
			body = ": " + string(b)
		}
		return fmt.Errorf("%s%s", resp.Status, body)
	}
	return nil
}
func (a *ssAuthenticator) CanAuthenticate(host string) error {
	url := fmt.Sprintf("api/catalog/accounts/%d/user_preferences", a.accountID)
	req, err := http.NewRequest("GET", buildURL(host, url), nil)
	if err != nil {
		return err
	}
	req.Header.Set("X-Api-Version", "1.0")
	if err := a.Sign(req); err != nil {
		return err
	}
	resp, err := a.client.DoHidden(req)
	if err != nil {
		return err
	}
	if resp.StatusCode != 200 {
		var body string
		if b, err := ioutil.ReadAll(resp.Body); err != nil {
			body = ": " + string(b)
		}
		return fmt.Errorf("%s%s", resp.Status, body)
	}
	return nil
}
// CanAuthenticate makes a test request to SS and returns true if it is successful.