Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Access issue in Confluence On premise REST API end point

Thomas Ladefoged
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 15, 2020

We are trying to invoke the Confluence REST API on-premise end point and it looks like it is not sufficient to provide only user id and password to get the content. When we provide a JSESSIONID cookie in the REST API end point as HTTP header then only we get the data. 

The question is what could be the reason that we are not able to use userid and password combination as mentioned in the documentation (https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/ ) in consuming REST API from confluence on-premise solution.

For example -

The below command is not giving any data

curl -u <userid>:<password> -X GET "https://wiki.xxx.dk/rest/api/space?spaceKey=~userid"

 

The below command provides us data.

curl -u m42713:xxxxxx --header 'Cookie: JSESSIONID=9DZZZZZZZZZZZZZZCCCCCCCCC1' \

-X GET "https://wiki.xxx.dk/rest/api/space?spaceKey=~userid"

1 answer

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2020

Hello @Thomas Ladefoged !

As I understand, you are currently trying to authenticate using basic authentication in Confluence On-Premises (Server/Data Center) but is unable to.

I am not entirely sure what is the meaning of “The below command is not giving any data”. Does it mean that:

  1. Are errors thrown when you try to authenticate?
  2. Has this worked at some point?
  3. Do you have some kind of SSO implemented on your instance?
  4. Are you using userID or username to try and login to the instance?
  5. Are there entries on your Confluence log file for when you try to login?

Also, here we have some documentation that can help you on this setup:

 

Let us hear from you!

Gunnarsson Johan _2_ September 6, 2023

I had a similar problem with authentication REST APIs towards Confluence after Atlassian deprecated the user+pwd authentication June 2023. When I had to switch to using a Personal Access Token, I read everywhere I should be using "Authorization: Basic " + Encoded user name + ": " + PAT, but that's only for Cloud deployments, for on-premise installations I had to use "Authorization: Basic " + Encoded PAT-token. 

Details are explained here: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

So properly documented in the end, just I went by everyone else's solutions posted on in Atlassian chats. All in all - the documentation is correct, but perhaps a bit vague. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events