Hello, I am trying to authenticate to my accounts API endpoint bit it keeps failing.
IO have used the Basic AUTH (HTTPBasicAuth) and Bearer Token (Header Authentication Method) methods but they both are not working.
Please can I get some input.
Thank you
Hi @Asiya Yunusa ,
Welcome to the community!
Without the actual error message you're getting it is a bit hard to pin point the actual problem. However, here are a couple things you might want to check:
The error message you should be getting will have much more information on what is happening, so if you can share that, we should be able to give you more specific hints.
Best regards,
Oliver
Thank you!
This is the error from Postman using the Bearer Token:
{
"error": "Failed to parse Connect Session Auth Token"
}
Yes, I am using the toke generated from my account.
I am trying to authenticate to Confluence cloud
The screenshot is how I am trying to authenticate with BasicAuth
I can curl from my terminal and it is successful with
curl -v https://mysite.atlassian.net --user me@example.com:my-api-token
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Asiya Yunusa ,
I'm not that big of an expert in Python, but I believe your code does not actually sends your credentials to Confluence. Here's what should work:
EMAIL = "YOU-EMAIL"
TOKEN = "YOUR-TOKEN"
url = "https://YOUR-SITE.atlassian.net/wiki/api/v2/spaces/SPACEID/pages/PAGEID"
auth = HTTPBasicAuth(EMAIL, TOKEN)
headers = {
"Accept": "application/json"
}
response = requests.request(
"GET",
url,
headers=headers,
auth=auth
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
@Oliver Siebenmarck _Polymetis Apps_ I am facing the same problem in javascript I tried with Basic token and also with Bearer token but none of them work. Can you please help me with that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Taha Siddiqui ,
The first thing to check would always be the error message you're getting, just because so many different things can go wrong. What kind of error message/code does the API return?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Oliver Siebenmarck _Polymetis Apps_ Now I am using the different approach. My requirement is that I have organization ID and API token and I want to use organization API but I don't have access token how can I create it I tried but it didn't work I am linking the picture. Can you please help me with that?
I am giving organization Id in place of client id and API token in place of client secret
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.