I'm helping a client use OAuth for JIRA that is linked to a Crowd user DB. Whenever the user tries to oauth against the JIRA authorisation endpoint they are redirected to their dashboard.
How do you do OAuth with JIRA when there is a Crowd User DB?
So after much hair pulling, I worked out what was going on here. The fact that Crowd was being used was a red herring. The problem was with the OAuth Redirects when you have different DNS details for the JIRA server externally to the network and externally to the network.
During the Oauth process the server which is external to a network requests a token from a JIRA server. It then goes to exchange that token for an authorised one by redirecting the browser to the JIRA Oauth authorisation endpoint.
However, in this case the endpoint is using the external host for the JIRA server and not the internal one so the browser can't find the server or cannot access the server due to the firewall.
There are several possible fixes for this: