How to authenticate to OnDemand from .Net

I can successfully connect to Jira using the Chrome Rest Console and get an issue in JSON. I used basic authentication. However, I cannot seem to do this from my local development PC using a .net web application. I've tried connecting using System.Net.WebRequest, System.Net.Http.HttpClient, jQuery.getJSON and even tried the Atlassian.Net SDK from NuGet.

All of these are giving me a 401 Unauthorized message. I'm confident my username and password are correct and base64ed fine since it works in the Rest Console.

I've tried code similar to this "answer" but am still 401 errors:

Does anyone have suggestions on what I can do to determine the issue? Is it related to running locally? Is there a specific part of the header that would cause this particular error message (althougth I've tried mirroring what the Chrome Console is sending)?

3 answers

1 accepted

0 votes
Answer accepted


I was logged into Jira in a browser, then running the Chrome Rest Console. The session was alive from the Jira login so it was burrying the fact that the Rest Console was not actually logging in.

I finallly found that the problem was using my email address and not my user login. I used my email becase that is what Jira was showing me in the browser. I didn't figure this out faster because of the console issue. So, make sure that you are using your Jira login and password (and not your email or any OAuth info.)

UPDATE: I just realized that it was working in the Chrome Rest Console only when I had another tab logged into Jira. When I logged out of Jira in the separate tab, the console gave me the 401 Unauthorized message. So, apparently the Console was not working afterall and instead using my browser session?

I've also tried using This did not work either.

I still cannot figure out how to authenticate. I'm wondering if it has something to do with the Google integration, although I'm using my Jira login and password (not my Google one.)

Hi Sean, did you ever figure this out? We are running into the same problem when trying to authenticate to OnDemand using Basic authentication from .NET.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Jira

Updates to give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

565 views 1 14
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you