public async Task <bool> TestApiCredentials(string apiHost, string apiKey) { var apiClient = new GitLabClient(apiHost, apiKey); var userResponse = await apiClient.GetUser(); // GetUser will throw exception when credidentials are not valid // so its safe to asume apikey is valid return(true); }