I'm having this problem. We have self-hosted confluence at my company. Basic authentication works with curl and username/pw:
curl -D- -u <username>:<password> -X GET -H "Content-Type: application/json" <confluence page to browse>
However, after getting a new API token from confluence website and substituting for the password:
curl -D- -u <username>:<API token> -X GET -H "Content-Type: application/json" <confluence page to browse>
it doesn't work - I get a 401 response and the following message included with other stuff:
Basic Authentication Failure - Reason : AUTHENTICATED_FAILED</p><p><b>Description</b> The request has not been applied to the target resource because it lacks valid authentication credentials for that resource.
It's curious that is used the words Basic Authentication Failure since I'm trying now to use API token and not Basic anymore.
I see answers online about:
- using network name instead of username
- leaving username blank (somehow)
- using email instead of username (for Basic authorization only username works, not email)
But these don't seem to work (and I don't know how to get my network username)