Forums

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

Can not use rest template to call Jira API

Nguyễn Dương Li January 22, 2021

Hi guys,

I'm trying to call jira api by rest template in my Java application, but its not working. The response code is 401: Basic authentication with passwords is deprecated.

idk But its work on postman. I tried both 2 cases:

-Using basic authen with username and password
-Add header

image.png

 

Any suggestion about this ?

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
January 23, 2021

Hi @Nguyễn Dương Li welcome on the community :).

You need to use access token as part of the basic auth. You can create it using this how-to article: https://confluence.atlassian.com/cloud/api-tokens-938839638.html

Let me know if it's working or not :)

Nguyễn Dương Li January 24, 2021

@Martin Bayer _MoroSystems_ s_r_o__  

sorry my mistake, I already use api_token, it works on postman but 401 when I call from my Java app.


Screen Shot 2021-01-25 at 09.08.46.png

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
January 24, 2021

Ok @Nguyễn Dương Li can you share your java app code?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events