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.
Hi Aniket
You'll need to authenticate prior to the call; you can see examples in this article:
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 S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Aniket for the update!
Let us know if you have any trouble or questions.
Kind Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.