I have been trying to perform an authenticated download using the ‘file’ command. I have tried setting up the HTTPHEADER option several ways:
First with a token:
set(ART_HEADER “"Authorization: Bearer mytoken"”)
and I have also tried an API key:
set(ART_HEADER “"X-JFrog-Art-Api: myapikey"”)
Then running the file command as such:
file(
DOWNLOAD “https://myartifcatoryserver/server/repolocation/filename.zip” “/file/saveas/location/file.zip”
STATUS DOWNLOAD_STATUS
LOG DOWNLOAD_LOG
SHOW_PROGRESS
HTTPHEADER ${ART_HEADER} )
All attempts to download return a status of 22.
I have tried downloading without the header using anonymous download, and that works fine.
If I add the header to try and download from that same repo, I still get an error.
Any ideas on what I might be doing wrong? This is using cmake version 3.22.
Thanks for any help!