code: func loginV1(authConfig *types.AuthConfig, apiEndpoint APIEndpoint, userAgent string) (string, string, error) {
  	registryEndpoint := apiEndpoint.ToV1Endpoint(userAgent, nil)
  	serverAddress := registryEndpoint.String()
  
  	logrus.Debugf("attempting v1 login to registry endpoint %s", serverAddress)
  
  	if serverAddress == "" {
  		return "", "", errdefs.System(errors.New("server Error: Server Address not set"))
  	}
  
  	req, err := http.NewRequest("GET", serverAddress+"users/", nil)
  	if err != nil {
  		return "", "", err
  	}
  	req.SetBasicAuth(authConfig.Username, authConfig.Password)
  	resp, err := registryEndpoint.client.Do(req)
  	if err != nil {
  		// fallback when request could not be completed
  		return "", "", fallbackError{
  			err: err,
  		}
  	}
  	defer resp.Body.Close()
  	body, err := ioutil.ReadAll(resp.Body)
  	if err != nil {
  		return "", "", errdefs.System(err)
  	}
  
  	switch resp.StatusCode {
  	case http.StatusOK:
  		return "Login Succeeded", "", nil
  	case http.StatusUnauthorized:
  		return "", "", errdefs.Unauthorized(errors.New("Wrong login/password, please try again"))
  	case http.StatusForbidden:
  		// *TODO: Use registry configuration to determine what this says, if anything?
  		return "", "", errdefs.Forbidden(errors.Errorf("Login: Account is not active. Please see the documentation of the registry %s for instructions how to activate it.", serverAddress))
  	case http.StatusInternalServerError:
  		logrus.Errorf("%s returned status code %d. Response Body :\n%s", req.URL.String(), resp.StatusCode, body)
  		return "", "", errdefs.System(errors.New("Internal Server Error"))
  	}
  	return "", "", errdefs.System(errors.Errorf("Login: %s (Code: %d; Headers: %s)", body,
  		resp.StatusCode, resp.Header))
  }
docs: // loginV1 tries to register/login to the v1 registry server.