From d9d77b4c1441140518592482653494253af82537 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko Date: Wed, 11 Oct 2023 22:36:12 +0300 Subject: [PATCH] New mechanism to fetch api token via password? --- .../BaseFixture.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/test/ReportPortal.Client.IntegrationTests/BaseFixture.cs b/test/ReportPortal.Client.IntegrationTests/BaseFixture.cs index 748918ac..98e50665 100644 --- a/test/ReportPortal.Client.IntegrationTests/BaseFixture.cs +++ b/test/ReportPortal.Client.IntegrationTests/BaseFixture.cs @@ -40,20 +40,7 @@ public BaseFixture() var uiToken = JsonSerializer.Deserialize(uiTokenJson); - using (var apiTokenRequestMessage = new HttpRequestMessage(HttpMethod.Get, "uat/sso/me/apitoken")) - { - apiTokenRequestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", uiToken.AccessToken); - using (var apiTokenResponseMessage = httpClient.SendAsync(apiTokenRequestMessage).GetAwaiter().GetResult()) - { - apiTokenResponseMessage.EnsureSuccessStatusCode(); - - var apiTokenJson = apiTokenResponseMessage.Content.ReadAsStringAsync().GetAwaiter().GetResult(); - - var apiToken = JsonSerializer.Deserialize(apiTokenJson); - - Service = new Service(new Uri($"{url}/api/v1"), ProjectName, apiToken.AccessToken); - } - } + Service = new Service(new Uri($"{url}/api/v1"), ProjectName, uiToken.AccessToken); } } }