code: func (auth *AuthProxy) GetUserID() (int64, *Error) {
  	if auth.InCache() {
  
  		// Error here means absent cache - we don't need to handle that
  		id, _ := auth.GetUserIDViaCache()
  
  		return id, nil
  	}
  
  	if isLDAPEnabled() {
  		id, err := auth.GetUserIDViaLDAP()
  
  		if err == ldap.ErrInvalidCredentials {
  			return 0, newError(
  				"Proxy authentication required",
  				ldap.ErrInvalidCredentials,
  			)
  		}
  
  		if err != nil {
  			return 0, newError("Failed to sync user", err)
  		}
  
  		return id, nil
  	}
  
  	id, err := auth.GetUserIDViaHeader()
  	if err != nil {
  		return 0, newError(
  			"Failed to login as user specified in auth proxy header",
  			err,
  		)
  	}
  
  	return id, nil
  }
docs: // GetUserID gets user id with whatever means possible