Skip to content

Commit

Permalink
New mechanism to fetch api token via password?
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Oct 11, 2023
1 parent 3440717 commit d9d77b4
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions test/ReportPortal.Client.IntegrationTests/BaseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,7 @@ public BaseFixture()

var uiToken = JsonSerializer.Deserialize<TokenModel>(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<TokenModel>(apiTokenJson);

Service = new Service(new Uri($"{url}/api/v1"), ProjectName, apiToken.AccessToken);
}
}
Service = new Service(new Uri($"{url}/api/v1"), ProjectName, uiToken.AccessToken);
}
}
}
Expand Down

0 comments on commit d9d77b4

Please sign in to comment.