How do I diagnose OAuth problems?

Jason Plumhoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2014

I've been trying unsuccessfully to make an application authenticate with JIRA through 2-legged OAuth.  Nothing I do seems to work - any request I make is bounced back with an error from JIRA:

{"errorMessages":["You are not authenticated. Authentication required to perform this operation."],"errors":{}}

So here's my question - how do I figure out WHY it is failing?  I'm not even seeing anything in the logs related to these attempts, so I can't figure out what JIRA doesn't like about my requests.  Any ideas?

Thanks,

Jason

2 answers

0 votes
Justin Justin December 5, 2014

AppFusions may be able to help you. We have a lot of experience with OAuth and OAuth2 with JIRA (the latter via a provider we've created for some of our integrations and any Atlassian app).

Troubleshooting through this thread is too complicated, since as you know, it's not straightforward/easy. Email info@appfusions.com if you'd like some focused assist. 

Jason Plumhoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2014

Hi Justin - thanks for responding. However, a few hours before your response came in I figured out what I needed to do to get it working (I documented on the thread I referenced in the original question). Too bad - you probably could have saved me several days of fumbling! On the other hand, there's no teacher like experience... Thanks, Jason

Justin Justin December 14, 2014

Good to hear - yes, seems like you'd been beating on that for a bit. Glad you got resolved!

0 votes
pschaff01
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2014

Hi Jason,

A suggestion would be to install the AppLinks Diagnostics Plugin in both applications you are linking and then run its tests to verify what is the message being returned.

In the results there will be links to pages which will help you to troubleshoot each error returned.

Cheers

Jason Plumhoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2014

Thanks Pietro - unfortunately, that plugin only seems to help with Atlassian applications. I apologize for not being clear earlier... I have an internally developed application from which I wish to push updates to issues through JIRA's REST interface. It works fine with basic authentication - but I'd prefer to use OAuth.

pschaff01
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2014

In this case there are a few questions that will helps us to diagnose this: - Are these applications sharing the same user base? - Do you see any message in the atlassian-jira.log file (located under <<JIRA_HOME>>/log)? Try to search for any error message in confluence.atlassian.com, answers.atlassian.com and jira.atlassian.com where this may be documented - Here is a KB that may help you to resolve the problem https://confluence.atlassian.com/display/JIRAKB/Application+Link+authentication+fails+due+to+bad+URL+signature

Jason Plumhoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 5, 2014

- Are these applications sharing the same user base? Yes - there is a single user (me). - Do you see any message in the atlassian-jira.log file (located under <<JIRA_HOME>>/log)? No - there is nothing in the logs. I even went into the log4j.properties and added an appender to capture DEBUG level oauth messages. Unfortunately, while it does show every gadget request, there is NOTHING captured when I make a request through my application - not even a rejection message. If it weren't for the fact that I'm getting a response, I'd think the request had never gone through at all. - Here is a KB that may help you to resolve the problem Unfortunately, this article doesn't apply. I'm not linking with another Atlassian app, and even if I was the URLs are correct. I'm not running behind a proxy, and I'm seeing no problems with the application link we already have with our Confluence instance. Any other ideas? I'm really stuck since I can't see what part of my OAuth request is causing problems...

Suggest an answer

Log in or Sign up to answer