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

Why am i receiving this error message: Client must be authenticated to access this resource

To whom it may concern,
As an organization, Boston Software subscribes to Jira and Confluence On-Demand and we're looking to automate the backup process.
I am able to successfully intiate backups manually, using the Web gui...
I'm trying to initiate backups progammatically and have hit a roadblock.
The end-result is that I'm failing to authenticate properly.
We found this knowledgebase article outlining the programmatic approach using a bash scrpt:<br< a="">> Our workstations and servers are all Windows-based, so I tried executing the bash script using CygWin.
The problem was I kept getting syntax errors.

Note: I'm using Powershell 4.0 and using the bash script as a pattern to follow.
Since I'm much more familiar w/ Powershell and the fact I've gotten much further using this approach - I'd like to stick w/ PowerShell.

More info:
The bash ... -Credential $cred -OutFile "\\<SERVERNAME>\DevOps\AtlassianBackups\" -PassThru
<# Confluence #>
Invoke-WebRequest -Method Get -Uri -Credential $cred -OutFile "\\<SERVERNAME>\DevOps\AtlassianBackups\" -PassThru

As noted in the summary, I was able to use the 'Manage Backup' web page to 'Create Backup' with no problem - I'm attempting to automate this process.

Note too that the credentials I'm using succeed when downloading the zip files

The big question is: If the commands to download the .zip files succeeded using my normal login credentials, why does authentication fail on the commands to initiate the backup?
The account I'm using is 'spalmucci' and I've also tried 'perkincr' with the same authentication error messages.

My belief is my account and the perkincr account have not been given appropriate permissions to the 'runbackup' folder.
At one point, my account (spalmucci) was able to Do the 'CreateBackup' thing, but could not navigate to the webdav folder. We needed to expressly give my account access to the webdav location.
I'm wondering if something similar is necessary for the 'runbackup' location.
If it turns out to be an account permissions thing...we'd like to use a general-purpose account, not one tied to a specific person.

The best way to reach me would probably be via email:
I can be reached via phone at: 781-449-8585 xt 224

Many thanks

Even more info:
These are the commands I'm executing in a powershell environment that are fialing with the folowing error message.
<# Jira #>
Invoke-WebRequest -Method POST -Uri "application/json" -Credential $cred -Headers $dictionary
<# Confluence #>
Invoke-WebRequest -Method POST -Uri "application/json" -Credential $cred -Headers $dictionary

The 'ContentType' argument is expressly provided in the commnad line and the 'Headers' argument: '$dictionary' is populated this way:
$dictionary.Add("X-Atlassian-Token", "no-check")
$dictionary.Add("X-Requested-With", "XMLHttpRequest")

Error Message:
Invoke-WebRequest : 401Client must be authenticated to access this resource.
At line:1 char:1
+ Invoke-WebRequest -Method POST -Uri
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

1 answer

Just were fighting today with similar issues and at least was able to reproduce bash script on powershell, you can look at it here:


Hope that helps

Александр, добрый день. 
Вам удалось победить ошибку из сабжа с помошью шел или пшел скрипта?

Suggest an answer

Log in or Sign up to answer

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