Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Connecting Bitbucket: Error! Invalid OAuth credentials.


Hi! This seems like something super basic, but I've been stuck on it for a few hours now, and am running in circles.

I'm trying to add a DVCS account for Bitbucket Cloud into our JIRA Software Server.

I generated an OAuth consumer in bitbucket (for our Team) , and copied and pasted the Key & Secret to the "Link Bitbucket Cloud or Github"/"Add New Account" dialogue.... and get:


Invalid OAuth credentials. Check Jira log for more information.

After adding an add-on - ScriptRunner - I have managed to actually get access to the log files. It tells us the following, rather unhelpfully:

2019-12-06 18:18:59,423 http-nio-8080-exec-19 WARN Julian 1098x2513x1 1o2vkzv /secure/admin/AddBitbucketOrganization.jspa [c.a.j.p.d.s.b.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET]
Headers: [User-Agent: Jira DVCS Connector/5.2.6]
Params: [parameters={}]
Response code: 401
Response headers: [Server: nginx, WWW-Authenticate: OAuth realm=" HTTP", Content-Type: text/html; charset=utf-8, Strict-Transport-Security: max-age=31536000; includeSubDomains; preload, Date: Fri, 06 Dec 2019 18:18:59 GMT, X-Served-By: app-1137, X-Static-Version: abd48467d96e, ETag: "d41d8cd98f00b204e9800998ecf8427e", X-Render-Time: 0.00551915168762, Connection: Keep-Alive, X-Version: abd48467d96e, X-Request-Count: 2891, X-Frame-Options: SAMEORIGIN, X-Cache-Info: not cacheable; response code not cacheable, Content-Length: 0]
2019-12-06 18:18:59,424 http-nio-8080-exec-19 ERROR Julian 1098x2513x1 1o2vkzv /secure/admin/AddBitbucketOrganization.jspa [c.a.j.p.d.s.bitbucket.webwork.AddBitbucketOrganization] Exception while trying to fetch UUID from OAUTH credentials. Check if the credentials are correct.
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor.checkAndCreateRemoteResponse(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor.request(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor.requestWithoutPayload(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor.lambda$getWithRetry$0(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.client.BitbucketRetryer.retry(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.client.BitbucketRetryer.retry(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor.getWithRetry(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor.get(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.AccountRemoteRestpoint.getCurrentUser(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.webwork.AddBitbucketOrganization.getOrganizationUuid(
at com.atlassian.jira.plugins.dvcs.spi.bitbucket.webwork.AddBitbucketOrganization.doValidation(
... 2 filtered
at com.atlassian.jira.action.JiraActionSupport.execute(
... 7 filtered
at javax.servlet.http.HttpServlet.service(
... 48 filtered
at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(
... 7 filtered
... 4 filtered
... 3 filtered
at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(
... 8 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(
... 66 filtered
... 1 filtered
... 39 filtered
at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(
... 10 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(
... 4 filtered
at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(
... 26 filtered
at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(
... 25 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
at org.apache.tomcat.util.threads.TaskThread$


Is there something I'm doing wrong? 

One note is that we do not currently have this running on a server that is accessible externally - because of IT reasons - but I figured that requests originating from our server should still be fine? (Also, it's running on port 8088 - again, because IT reasons...)


2 answers

1 accepted

9 votes
Answer accepted

Okay, after button mashing a bit harder, it seemed that checking "this is a private consumer" made it work. This is not in the documentation.


Hopefully this fixes somebody else's issue!

Thanks so much fo rposting this!  I was going in circles also and creating the OAUTH key pair 3 times without success until I read this :) 

Like julianhaagsma likes this

Thanks Julian - I had the exact same problem and your solution worked perfectly!

Same issue - thats it :)

I'm not generating the OAuth information so I don;t have acess to Bitbucket. I don't see such a button in Jira, was the button mashing on the side?

Yes it is a checkbox when generating the OAuth consumer 2020-06-11 19_50_58- _ add oauth consumer — Bitbucket.jpg in Bitbucket when generating

Like Rich Scire likes this

It might help someone in the future..... we were able to make it work by checking the "This is a private consumer" box when creating the OAuth access token on Bitbucket (this page: doesn't mention the box)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,927 views 37 49
Read article

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