Forums

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

How to make Jira OAuth redirect to my App after authentication

lokesh cherukuri
Contributor
October 25, 2018

I added Jira OAuth to my webapp following docs at https://developer.atlassian.com/server/jira/platform/oauth/ . I used sample code they provided in that article.  Here is how it is working now:

1. Use will click `Login with Jira` button on webapp.

2. Backend will generate a token and open a new tab with URL something like `https://jira.company.com/plugins/servlet/oauth/authorize?oauth_token=ec3dj4byySM5ek3XW7gl7f4oc99obAlo`.

3. Above link will take user to Jira for authorization. When user click `Approve`. He will be given a verification code like 'qTJkPi'. He will submit this back to webapp.

4. Backend will exchange token (step-2) and verification code (step-3) with jira for a `Access Token`.

 

Here user has to copy the verification code manually and submit to webapp. Can we make Jira automatically redirect user to Webapp after authentication along with verification code?

 

2 answers

0 votes
swapnildeshpande69
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 2, 2022

HI I have answer to this as I have faced same problem and managed to solve this issue.

 

In you backend implementation, like in my case for java ,

You need to set callbackurl to your url instead of "oob" as mentioned in jira server document.

This will redirect to your url after authorisation along with verification code in URL. 

OAuthGetTemporaryToken class has field "callback" which you need to set as custom url.

0 votes
Rajitha Madushan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 27, 2022

Hello Lokesh cherukuri,  I was trying to develop the same type of web application by using Flask, and somehow I was managed to get an authorized token, But as you mentioned here I am also stuck in the stage of redirecting to my App after authenticated by JIRA, You asked this question ages ago, and I hope that you could found an answer, if Yes, would it be possible to share your answer with me and I would really appreciate if you can provide me a solid answer. Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events