How to access SSO enabled JIRA Sever using Rest APIs

Sai Segu February 23, 2021

Hi 

I'm trying to access JIRA resources using Rest APIs

Its a JIRA Server where SSO is enabled

the end point I have used is : https://[siteURL]/jira/rest/api/latest

I have used basic authentication and I see a 404 error

 

can someone please help me if there are any additional steps needed to be done like creating any API tokens or as an administrator enable Rest APIs. 

 

Thanks in Advance

4 answers

1 vote
Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2021

Hi @Sai Segu

if the most basic endpoints that Hana mentioned

GET /rest/api/2/project (or GET /rest/api/latest/project)

fail in your scenario you need to work out on how SSO is implemented in your Jira instance.
Installations which I have seen and which make use of SSO integrations allow REST API access without any trouble - meaning without any 404 pages coming up.

In first step I would try to find out which implementation of SSO is in use (there are several apps as well as open source solutions), then to determine how it is configured, if REST API access is possible in general.
In case you did not install it yourself getting in contact which subject matter experts on the authentication/SSO setup.

Cheers,
Daniel

0 votes
b.kuppusamy January 25, 2023

hi @Sei
This is what I did.

 

1. Installed Postman
2. Create a "New Request" in postman
3. Generate the GET API URL. 

- Basically I am trying to get the issue details from JIRA Cloud. So, here is how I generated the url.
- First part of URL is my JIRA link (https://<company>.atlassian.net/) or the domain url that you are using to access your tickets. 
- Build the rest of URL based on the need. Refer to this page for the more details on the second part of url. https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-search/#api-rest-api-2-search-get
- So now the URL Is https://<<company>>.atlassian.net/rest/api/2/search
- I am using my JQL to complete the remaining part of URL as below. After the word 'search', enter "?jql=<your JQL>".
- Now the whole URL is
https://<<company>>.atlassian.net/rest/api/2/search/?jql=project = "<<proj_name>>" AND issuekey in (<<issueid1,issueid2..>>) ORDER BY status DESC

4. Now in Postman, enter this URL for "GET"
5. Click on Authorization > Select "Basic Auth"
5. Enter your username under "Username".
6. For password, you will need to actually enter your API token. See below steps to generate the API Token.
- In JIRA Cloud, Click on your picture/icon > Profle > Manage Your Account > Security > Create and Manage API Tokens (https://id.atlassian.com/manage-profile/security/api-tokens) > Create API Token > Copy the token. Make sure you copy the token to a notepad, because you can never see the token again. 

7. In postman, Enter this APIToken in your password,, and click on Send to see the response.

This should work. 

0 votes
Mahima_miniOrange_SSO
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 23, 2021

Hello @Sai Segu 

You can use the add-on mO API Token/OAuth Authentication for Jira to use either OAuth 2.0 or API Tokens to authenticate your REST APIs.

It's really easy to set up with any other provider which you might be using for SSO. You can use the guides provided on the link below to set it up.

https://plugins.miniorange.com/jira-rest-api-setup-guides 

Also, if you have any questions regarding it, you can reach out to info@xecurify.com

PS: I work for miniOrange, Top Atlassian SSO Vendor! 

I hope this helps you! :)

Sai Segu February 25, 2021

Thanks @Mahima_miniOrange_SSO . But I'm looking for some solutions that costs nothing. Not sure if that is doable. 

Like johnykutty_mathew likes this
0 votes
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 23, 2021

Hi @Sai Segu ,

welcome to the Atlassian Community!

Would you please us more information, which resources are you trying to access? What you are trying to do?

This basic URL won't work, you need to find correct endpoint...

See here for more information...

Sai Segu February 23, 2021

Thanks for the answer.. Right now I want to start off with just being able to authenticate to the SSO enabled JIRA Server and I have no success so far. 

I have tried:

http://host:port/context/rest/api-name/api-version/resource-name which in my case I assumed is https://[siteURL]/jira/rest/api/latest and also https://[siteURL]/jira/rest/auth/latest. None of them worked

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 25, 2021

Hi @Sai Segu ,

if you want to do some sort of test like this, try getting all projects which are visible for your user:

GET /rest/api/2/project (or GET /rest/api/latest/project)

Suggest an answer

Log in or Sign up to answer