It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ERROR - {"message":"Client must be authenticated to access this resource.","status-code":401}

We were using this script to make BACKUP from linux, but about 1 month ago it fails with these error:

{"message":"Client must be authenticated to access this resource.","status-code":401}

 

(PART OF SCRIPT)

COOKIE_FILE_LOCATION=jiracookie
curl --silent --cookie-jar $COOKIE_FILE_LOCATION -X POST "https://${INSTANCE}/rest/auth/1/session" -d "{\"username\": \"$USERNAME\", \"password\": \"$PASSWORD\"}" -H 'Content-Type: application/json' --output /dev/null


BKPMSG=$(curl -s --cookie $COOKIE_FILE_LOCATION -H "Accept: application/json" -H "Content-Type: application/json" https://${INSTANCE}/rest/backup/1/export/runbackup --data-binary '{"cbAttachments":"true"}' )

Can you help me?

 

 

3 answers

1 accepted

3 votes
Answer accepted
edwin Community Leader May 06, 2019

Hi @Marcelo Riveiro ,

Authentication with username and password is deprecated. You'll have to create and use API tokens

Deprecation notice - Basic authentication with passwords and cookie-based authentication

Thanks for the response and help.

0 votes

I changed my way to call API and now i am using token instead of password. But still i am getting 401 issue "Client must be authenticated to access this resource".

0 votes
ji wenhao I'm New Here Nov 03, 2019

Just like what @Chintan S Soni said, I found the same problem when I call API by using api token without password. Please do me a favor!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

842 views 5 22
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you