Forums

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

Authorization failing when using Atlassian.SDK with bearer token

Ivana Tesanovic
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 8, 2024

Hi everyone, I am trying to create an issue using the Atlassian.SDK v13 library in .NET. However, I am getting a 401 with this error:

console.warn('DEPRECATED JS - contextPath global variable has been deprecated since 7.4.0. Use `wrm/context-path` module instead.');

I am using this line of code (below) to create a Jira client in C# which only accepts username and password. Is there a way to use the bearer token? I tried passing the bearer token / basic auth token as a password, but getting the same error.

Atlassian.Jira.Jira.CreateRestClient( url, username, password );

When I use POSTMAN with Bearer token auth, it works.

I guess my question is is this deprecated, is it even possible to use in this scenario? If not, is the only alternative to create a HTTP request and send it directly from the code, without using the library?

Any help is appreciated! Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Ivana Tesanovic
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 9, 2024

Okay, figured it out - in case someone stumbles upon this question.

Url: your Jira URL
Username: your EMAIL address
Password: your Basic API token (not encoded with the email address but rather what you get directly from the creation)

To create the Basic API token:
- go to Profile -> Configure API key
- select Basic auth
- copy the Key that you get and that's your password

Cheers!

Suggest an answer

Log in or Sign up to answer