Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Oauth jira authentication client returns 405 when requesting token

Edited

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

0 votes

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!

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Automation

New to Jira Automation - goodbye Cron (sort of), hello new project created trigger, new additions to

Hey Everyone! Simeon from the Automation team here. I'm delighted to share some new features and improvements that we are shipping to Jira automation (Cloud only). Firstly, @Sam Harding&nbsp...

2,811 views 10 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you