Is there any Confluence REST API which authenticates a confluence Edited

Working closely on Jira & Confluence REST API's 
Jira API to authenticate user :  https://tickets.ingramcontent.com/rest/auth/1/session

body

{
"username": "someUserName",
"password": "somePassword"
}


So I've found the respective REST API for Jira for authenticating a jira_user...

But im unable to find a suitable REST API CONFLUENCE which authenticates a conf_user...& need such that satisfies the same goal such as Jira REST API

Is there such Confluence REST API which authenticates a conf_user?


If Not....how do I find out a work-around to authenticate a conf_user ?

Thanks in advance.

1 answer

1 vote

Hi Aniket

You'll need to authenticate prior to the call; you can see examples in this article:

Confluence REST API Examples

See the text before the call:

curl -u admin:admin

Let us know if you have any questions.

Kind Regards,
Shannon

apologies for late reply...kept this issue on stand by n moved on due to other priorities.


surely will work on your solution & post my response once i go back n get that done. haven't got a chance to do so lately.

thanks for your reply @Shannon Spaniol

Thanks, Aniket for the update!

Let us know if you have any trouble or questions.

Kind Regards,
Shannon

Hi Shannon.

My motive just was to validate the confluence user...which I am able to do very easily in the case of Jira...since jira has its own authenticateUser ReST API : Jira Login

But there isn't any such dedicated ReST API for confluence login,
or to authenticate confluence user at the moment.

what u mentioned above worked for me. :)

curl -u admin:admin

example :

curl -u user123@gmail.com:password123 -X GET -H "Content-Type: application/json" https://yourDomainName/rest/api/user?username=user123@gmail.com

writing down my small detailed findings for others who come across this same scenario.


The above curl command when executed internally first validates the credentials mentioned, which in turn if are valid then invokes the confluence url mentioned in the later part of the curl command.

therefore, we get a

"200 OK" response on success & valid credentials.

"401 unauthorized" response is for INVALID credentials, i.e invalid userName or password provided.

"403 forbidden" i.e the API invoked was prompted for a CAPTCHA CHALLENGE. therefore the api invocation & curl command execution failed and the response is 403...here the credentials are valid but due to captcha challenge it gave a 403 error. this might be handled of admin level for those user to disable the captcha.

the Confluence ReST API used is simple : get user

https://docs.atlassian.com/confluence/REST/latest-server/#user-getUser 

Initially I was really struggling...thought why couldn't confluence just expose a API for login/authenticateUser ... simply would have helped people n saved time. Anyways this does my intended work.

I actually saw that page & overlooked it...at that time was just hunting for some dedicated API for this purpose. anyways..

Thanks for the Pointer.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 7 hours ago in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

86 views 0 11
Read article

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