I am trying to access JIRA Rest APIs for which I would need authorization token to access the APIs. I am using OAuth 2.0 for this. Refer this link : https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/ This is what I am trying to achieve. This is the endpoint https://auth.atlassian.com/authorize? audience=api.atlassian.com& client_id=YOUR_CLIENT_ID& scope=REQUESTED_SCOPE_ONE%20REQUESTED_SCOPE_TWO& redirect_uri=https://YOUR_APP_CALLBACK_URL& state=YOUR_USER_BOUND_VALUE& response_type=code& prompt=consent I am hitting but I am not getting error "Javascript is disabled" error.
Hi @Rahul Shekhawat ,
welcome to the Atlassian Community!
Would you please provide us more info, what you are trying to achieve? To which endpoint are you sending requests? How exactly does your request look like? Do you have some script for it, or are you using some application for sending requests?
Thank you.
What, exactly, do you mean by "authorisation code"? Where are you looking?
I ask because it's clear the page you're asking it of needs to be able to run javascript, it's not intended for you to do things with a non-interactive call. My guess would be that it needs you to log in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- , I am trying to access JIRA Rest APIs for which I would need authorization token to access the APIs. I am using OAuth 2.0 for this. Refer this link : https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/ This is what I am trying to achieve. This is the endpoint https://auth.atlassian.com/authorize? audience=api.atlassian.com& client_id=YOUR_CLIENT_ID& scope=REQUESTED_SCOPE_ONE%20REQUESTED_SCOPE_TWO& redirect_uri=https://YOUR_APP_CALLBACK_URL& state=YOUR_USER_BOUND_VALUE& response_type=code& prompt=consent I am hitting but I am not getting error "Javascript is disabled" error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, that still looks like you are trying to hit a page intended for a human to use in a browser, not something you hit with a get. What happens when you follow the documentation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exactly. Basically you need to open the authorization code request uri in a browser. Perhaps you tried to make the request in Postman or a similar tool which results in this error. As soon as you open the endpoint in a browser you'll be prompted to sign in and allow the app access to your account. After that, you are going to receive a code with which you can request an access token with a post request.
Please refer to these two sections in the documentation:
Direct the user to the authorization URL to get an authorization code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Yann Herren
I am working on the same thing as @Rahul Shekhawat
I followed your suggestion. I open that endpoint in the browser and accept the app access in my account but I am confused that where I will get the authorization code. Will you please help me with this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @FAsmani
Basically you need to open that endpoint in the users browser. The then user authenticates with its credentials and consents to the app you created in the developer portal. You also need to define a Callback URL in your registration. This is the URL the user gets redirected to after a successful login. The authorization code is provided as the query parameter 'code' in the redirect call. So your redirect URL might be https://yourwebsite.com/yoursubsite. The OAuth redirect from Atlassian might look like this then: https://yourwebsite.com/yoursubsite?code=your-authorization-code
The documentation states this as well:
If successful, the user will be redirected to the app's callback URL, with an authorization code provided as a query parameter called
code
. This code can be exchanged for an access token, as described in step 2.
On your end you then have to use the value of the query parameter to fetch an OAuth token in order to make authorized api calls.
Please refer to the section Direct the user to the authorization URL to get an authorization code in the documentation for further information.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.