It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence Oauth Authentication

Hi;

I looked confluence doc. for oauth in that link https://developer.atlassian.com/display/CONFDEV/Confluence+JSON-RPC+APIs and https://developer.atlassian.com/display/CONFDEV/Confluence+REST+APIs+-+Prototype+Only .it seems we can connect confluence with oauth take accestoken . But there is no example and doc. not explain good. I want create tokens and connect confluence with that. Can ı take information oauth for XML-RPC and SOAP APIs or JSON-RPC APIs. How can ı create tokens and connect my confluence? For example for jira: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+OAuth+authentication. I want like that.

8 answers

4 votes
John Tolle May 30, 2017

For anyone still looking for an answer, Ken has the right idea with his example above.  The base URL for OAuth for Confluence appears to be as follows:

https://yourinstance.jira.com/wiki/plugins/servlet/oauth/

And the endpoints are the same as JIRA:

request-token

authorize

request-token

While all of the other information about how to use OAuth is exactly as documented for JIRA, I still cannot find the official documentation on the Confluence base URL and endpoints.

3 votes
John Tolle May 31, 2017 • edited

Additionally, it matters how you send the OAuth requests.

For the entire token-based OAuth dance, be sure to send the OAuth fields in the POST, not the HEADER or in the Query String.

To GET/POST/PUT pages, etc., always send the OAuth fields in the Query String and NOT in the POST.

Again, these kinds of things should really be documented, but they are most definitely not!

Bernhard Millauer Jul 10, 2017

Thank you John, thank you so much! I wasted hours figuring out why the **** my token get rejected all the time.

For anyone who has the same problem:
JIRA needs the oauth signature properties in the HEADER, Confluence (same company...) in the GET/POST as described.

 

2 votes
John Tolle Jun 21, 2017

I've created an example for using OAuth with Confluence in PHP here:

https://github.com/jt-github/atlassianapi

or, if you prefer Bitbucket (and hey, we're on an Atlassian site, right?):

https://bitbucket.org/johntolle/atlassian-oauth-confluence-php-example/src/2f15a6e970d23c8a3d7524c6173abb5ecf09b956/php-confluence/?at=default

0 votes

Does not anyone use confluence oauth? I want to enter with access tokens to confluence. How can I do that?

0 votes
Joe Clark Atlassian Team Apr 03, 2013

This examples for JIRA should would work the same with Confluence.

Brett Profitt Apr 07, 2014

It doesn't. The authorize URL doesn't work in Confluence.

0 votes
Mesut Şahin Apr 03, 2013

Can you explain with an example how can ı connect with conflence. I use jirashell for jira API. And I use that code : https://jira-python.readthedocs.org/en/latest/#oauth . I want to connect with accesstoken to confluence and make something. for example edit a page with access token. Have you any example? it can be any programming language. I want like that https://confluence.atlassian.com/display/DISC/XML-RPC+Page+Updater+Example but this is XML-RPC

0 votes
Mark Mackay May 13, 2014

Hi Mesut -

I think I tried something similar to you a while back (Previous discussion here -- https://answers.atlassian.com/questions/63827/login-to-confluence-web-interface-using-token-from-soap-api-sso-without-crowd)

I finally got arount to trying Joseph's suggestion in this thread, and it did the trick. And I've published the code hacks here:

Hope that helps at least point you in another possible direction.

/Mark

0 votes
Ken Lassesen Nov 17, 2015

I have OAuth1.0a code written for Confluence but like above, I cannot locate the URL that I should be calling.

See https://jira.atlassian.com/browse/CONF-39916 for what seems to be related.

Using an OAuth1.0a library

client = new OAuthRequest
{
Method = "GET",
Type = OAuthRequestType.RequestToken,
SignatureMethod = OAuthSignatureMethod.HmacSha1,
ConsumerKey = String.Format("{0}@avalara.com", REDACTED),
ConsumerSecret =REDACTED
RequestUrl = "https://avalara.atlassian.net/wiki/plugins/servlet/oauth/request-token",
Version = "1.0a",
Realm = "avalara.com"
};

I get null for the token,

  • is the URL right?
  • is the realm right?
  • is the signature method correct?

 

 

 

 

 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Statuspage

⭐️Would you recommend Statuspage? Leave a (honest!) review. ⭐️

Hi Community friends, We're working on sourcing more reviews on Capterra – a popular software review site –  to help teams like yours make more informed decisions when choosing an inc...

86 views 3 5
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you