I'm trying to use .netrc file to authenticate access to a service, but I can't make it use Bearer authentication type!
I can access the service without .netrc with the following command:
curl --header "Authorization: Bearer <TOKEN>" "http://<url/to/service>"
I use .netrc file with the following command:
curl --netrc-file "<path/to/.netrc>" "http://<url/to/service>"
The .netrc file looks like:
machine <server domain>
password <TOKEN>
When I try it, I got
{"message":"Basic Authentication has been disabled on this instance."}
I changed password with account in the .netrc file, but got the same response.
.netrcin curl only works with Basic-style user/password auth. It can not emitAuthorization: Bearer .... That’s why you seeBasic Authentication has been disabled. If you need Bearer tokens, you will have to use-H "Authorization: Bearer <token>"directly, or put that header in a~/.curlrc(or--configfile) instead of.netrc.