Since Tempo for JIRA decided to remove the support of access token, I’ve to migrate the connection to the OAuth 2.0 flow in my console application that exports some things from the API.
I’ve been able to create a OAuth 2.0 access for their API, so I’m having an Client ID and a Client secret.
I’m trying to connect to their API(Doc here: https://apidocs.tempo.io/v3/ ), with the following code:
RestClient tempoRestClient = new RestClient("https://api.tempo.io/")
{
Authenticator = new HttpBasicAuthenticator(_tempoClientId, _tempoClientSecret)
};
RestRequest request = new RestRequest($"core/3/worklogs/user/{userId}", Method.GET);
request.AddQueryParameter("from", from.ToString("yyyy-MM-dd"));
request.AddQueryParameter("to", to.ToString("yyyy-MM-dd"));
IRestResponse<JiraWorklogs> restResponse = tempoRestClient.Execute<JiraWorklogs>(request);
But the restResponse.Status
is “Unauthorized”.
When I did generate the client ID/Secret, I had to specify a redirect URL, which I gave “localhost”, since it’s only a console app.
Any idea what I’m missing?