尝试使用RestSharp从Jira请求访问令牌时,我收到错误请求响应。我的代码如下。
string url = "https://my_server.atlassian.net/plugins/servlet/oauth/request-token";
var client = new RestClient(url);
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("client_id", "OauthKey");
request.AddParameter("client_secret", "secret_key");
request.AddParameter("grant_type", "client_credentials");
var response = client.Execute(request);
此处的密钥应该是我生成的私钥,还是与Jira中的应用关联的公钥?另外,客户端ID真的只是我在Jira中放入该字段的硬编码值吗?所以它可以是我想要的,在这种情况下是OauthKey?
我觉得我很接近,但我似乎无法获得令牌。