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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

How to Access the Verification Code When Requesting Access Token

Hello guys,

I am building application, that will have the feature to access Jira's database and create issues in Jira as well. I followed this guide:, however there are some thing unclear to me...

I am able to get the request token, but how do I extract the Verification code? 

In the guide it is said to copy it from the web page, I am redirected to after I give permission. Is there any way to extract this code? 

Thanks a lot!

 

2 answers

1 accepted

1 vote
Answer accepted

For anyone who is having the same issue as I did - here is how you could get around it:

Notice that when you click ALLOW, then you are redirected to a window and in its url you have the request token and the verification secret, then I used HostListener to get the info from the url and pass it to the access token request

@HostListener('window:message', ['$event']) onMessage(event) {
this.authService.authorizeWithJira(event.data.value.token, event.data.value.secret)
.subscribe((data: string) => {
localStorage.setItem('token', data);
this.syncWithJira();
});
}

Note: authoriseWithJira is a method in the authService, that send request for the access token.

Note: Jira has CORS disabled and you might need to do this on the backend.

0 votes

Hi Martin and welcome to Atlassian Community!

As per I could understand on the guide, after you request the token and go to the URL that appears on the terminal, you will see the option to Allow or Deny. Clicking on Allow will show an output on your browser with the verification code:

Access Approved
You have successfully authorized 'Example JIRA app'. Your verification code is 'qTJkPi'. You will need to
enter this exact text when prompted. You should write this value down before closing the browser window.

Are you facing some issue after clicking on "Allow"?
Have you tested using another browser just to make sure that there is nothing blocking this output to be generated?

Regards,
Angélica

Hi, Angelica, thank you for your help.

The problem was that the guide I was following was made so the verification code is shown in a browser window, after you click ALLOW, then you have to copy it and send it in order to receive an access token. Which was obviously not what I wanted.

I will post a separate answer to explain how I managed to get around this if anyone has the same problem in the future.

Thanks for the time.

Like Angélica Luz likes this

Hi Martin, After clicking on Allow, does the response have the verification code? I checked the browser's network tab and do not see any response. I just see the following message in the browser. 

Access Approved

You have successfully authorized 'elite'. Please close this browser window and click continue in the client.

 

This is a windows desktop app.

Suggest an answer

Log in or Sign up to answer
TAGS

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