May 12, 2017 8:18:34 PM org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm="redacted", oauth_problem="consumer_key_unknown"}
com.google.api.client.http.HttpResponseException: 401 Unauthorized
oauth_problem=consumer_key_unknown
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1070)
at com.google.api.client.auth.oauth.AbstractOAuthGetToken.execute(AbstractOAuthGetToken.java:73)
at com.atlassian.oauth.client.example.JiraOAuthClient.getAndAuthorizeTemporaryToken(JiraOAuthClient.java:37)
at com.atlassian.oauth.client.example.OAuthClient.handleGetRequestTokenAction(OAuthClient.java:69)
at com.atlassian.oauth.client.example.OAuthClient.execute(OAuthClient.java:51)
at com.atlassian.oauth.client.example.ClientMain.main(ClientMain.java:18)
Is there something that could be preventing this from working that isn’t documented? I’ve setup an example application in our JIRA installation under the Application Links. I’m not sure how to investigate since we don’t host JIRA where I can look at the logs
I found the problem. There’s a typo in the documentation. It says to set the Consumer key to OAuthKey when setting up the Application Link. But this is wrong by 1 character, it’s actually a lower-case a as in OauthKey.
com.google.api.client.http.HttpResponseException: 401
oauth_problem=consumer_key_unknown
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1070)
at com.google.api.client.auth.oauth.AbstractOAuthGetToken.execute(AbstractOAuthGetToken.java:73)
could this be due to some issue in keys, or is it the consumer type.
I have corrected the typo issue as well, but this error is still coming…
I am not sure if that is still a problem, but I had to make sure that jira_home url is set in a proper format in order to make everything work correctly.
jira_home=https\://tfk-sandbox2.atlassian.net
not that there is \: after https and no trailing slash
@ChandanKumar welcome to the Atlassian developer community.
And for any others stumbling across this thread, please be aware that OAuth 1.0a remains for legacy reasons (it’s right there in the title); however, there is a much better supported and easier to implement OAuth 2.0 option. OAuth 2.0 wasn’t available at the time of the original post, but if you are just starting work on a REST API client now, our recommendation would be the newer auth method.