The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Jira cloud REST API - Login endpoint is always giving me 401 error

awajieh
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 19, 2020

Hi Team,

 

I am using JIRA cloud system. and i want to use the public REST api in due automation furthers.

 

I am trying to login using the following endpoint:

POST https://awajieh.atlassian.net/rest/auth/1/session

BODY {"username":"my email", "password":"mypassword"}

 

Response

{    "errorMessages": [        "Login failed"    ],    "errors": {}}

 

What is the issue since i am login on web portal using the same information and i am able to login.

 

please verify

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Veera
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 19, 2020

Hi @awajieh 

Using passwords with Jira REST API basic authentication has been deprecated. You need to create API token and use it in the REST call.

 

Below document explains how to create and use API token for authentication.

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

1 vote
Edwin Kyalangalilwa
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 Champions.
January 19, 2020
Edwin Kyalangalilwa
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 Champions.
January 19, 2020

This is before I saw @Veera's answer

Like Veera likes this
Maycon Belfort
October 2, 2020

Hi @Edwin Kyalangalilwa ,

 

So... How to do a HTTP authentication with Rest API?

What headers option should I include?

Content-Type: application/json;charset=UTF-8

Authorization: ???????

 

Thank you

Like Edwin Kyalangalilwa likes this
Edwin Kyalangalilwa
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 Champions.
October 3, 2020

Hi @Maycon Belfort ,

Please take a look at this documentation for more information.

Basic authentication 

For the username/password example, it would be best to pass in just the username and you'll be prompted to input a password. 

Like Maycon Belfort likes this
TAGS
AUG Leaders

Atlassian Community Events