The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Oauth jira authentication client returns 405 when requesting token

Lingxiao Wu
July 8, 2020

Hi all,

I am following instructions at https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/ to get the access token for jira api access. However, at the step of requesting temporary token by calling the request-Token endpoint(/plugins/servlet/oauth/request-token), it keeps returns 405 Method Not Allowed for me.  When I changed the method from "post" to "get", this error is gone, however returns null token. So it looks to me my private key and consumer key are passed correctly, so what could be wrong?

com.google.api.client.http.HttpResponseException: 405 Method Not Allowed
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)

Process finished with exit code 0

 

My config.properities file is:

jira_home=https\://jira-test.company.com
consumer_key=userconsumerkey
private_key=x2DbAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAL0n4Cl6g77wLviGZCby50Ba/LlUa2JNpqtCKbi0ZwqUHDKxpbO3vbCHowFPKBDi2wz0rjHj/YltcUfkomP8j8ZuqRavREoBPBVzl08jz08CwVtxSdd5qjknAv9PJ6CQy4Z/pGuVKj5d9zowoirOGF8W2uquZae1SPPkGS1TAN45AgMBAAECgYEArGvbxpN54iOX/UyroGFMcHo/4kPUetAje/qcg1RWlOr7ZS5PyClVzMNmz7uy3umbGQ00eB/FrW7IkusTJ6dB+eGPYdRC3zT28F8/siXVKo+KUcgvQGXNnmnlGmZzOQho2d3gWms83V+NXeQmZw1rqe8YQZ32r3fXQe5+96D+xQECQQDwMuXrom082DGMLIa+8b392GKMYb8VJc8wMf35Ouxj9dP6q50989f/xSK34apTpM06VuEG0EV1/X2qU/4l0zihAkEAyZlhOD22dQr1ySdrmzOsfCdOERi48zWX5FCFmFKi6Cv45fBbwNgYQxv+xXfCYgFGWdw2pA4wZN2AdcTvaUhGmQJBAObtGC0tcHZBp4kLOdSTl0RYZ45tXwcW3ZWJSpH1O1Vy/wSNP1RTfcNxpK0xH4rg80n2QsuJKm6gcdNygvGcm2ECQEpq0/huz2tlIFWgt5gS+xjZaXfmKF+e6PLexnH0Dy6lDLvUfgoxusMLEoDSNG75CX8iSwlEM5kIKuNOTxIOHAECQQCmfDnhNmIyFnFqny1I7DhaobE7FjOjn57P4qN1yr9E7IKU7psT3VvIUljO41aqe42NuN3/4C0+9CIn+ugLtIJl

 

thank you very much

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 12, 2020

Hi there!

Firstly, I would strongly recommend you delete/edit this post to remove config.properties information from the post, as it contains sensitive information that you do not want shared.

Secondly, I do not think this is the right place to post this question, as this is the community for the Automation for Jira. I think you're looking for 'Jira' community, so maybe remove this post and repost your question (without the key info) there.

Thanks!

Lingxiao Wu
July 29, 2020

Thank you for your response.

I did modify the private key and other confidential info when posting here but thank you for bringing this up

Just an update the issue is fixed by not using string concat for the private key string, instead of converting it to one line string.

TAGS
AUG Leaders

Atlassian Community Events