Confluence REST API token authentication

I have an app that authenticates users using LDAP (Active Directory). We also use LDAP for Confluence authentication.

I'm using the REST API to integrate Confluence with our app and I'd like the API requests to be executed in the user's context. This would enforce that a user only does what he/she's allowed to do as well as make sure that new post created/updated with the API carry the user's "stamp".

It seems like the older API had a way of issuing request with token instead of basic auth (username/password) but I can't seem to find the correct way to do this now.

Is it at all possible? Would anyone have a suggestion for a different way to accomplish what I'm trying to?

One thing important to me is not to hold onto the user's password. I would pass is authentication credentials on login, directly to Confluence's API, without having to "save" it somehow to be used later on.

 

Thanks!

 

PS: Running Confluence 6.3.1

2 answers

0 vote

Confluence REST API does not provide a way of obtaining user tokens. You can still use old xml-rpc api method calls for authentication and other actions you need.

Alternatively, in your application, you may try to login your users by sending user credentials to Confluence login page, and parsing response. You need to save "seraph.confluence" and "JSESSIONID" cookie values from response, and use them in you REST calls (just add them to cookies header of your requests). That may do the trick, but may not work in all cases.

Hope that helps.

Thank you Maksym, it points me in the right direction.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

873 views 21 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you