JIRA Authentication error with 2.0.0-beta2

Issue #198 resolved
Jeanyhwh Desulme created an issue

I’m trying to set up the Jira Integration with VsCode and anytime I put in our Jira url (https://jira.company.com/issues) it continually just shows a 404 error. In our environment we’re running Jira Datacenter 8.4. We also have the native SAML SSO turned on for it as well. I’m not sure that’s an issue though because this is working just fine for our Bitbucket DC implementation.

I have enabled debugging log in the Output viewer but it unfortunately doesn’t provide the url structure it’s trying to use.

[2019-09-30 21:42:03:789] Atlassian for VSCode (v2.0.0-beta2) activated in 21 ms
[2019-09-30 21:42:03:877] You have gone online!
[2019-09-30 21:42:04:439] Atlassian for VSCode upgraded from v2.0.0-beta1 to v2.0.0-beta2
[2019-09-30 21:43:02:658]  Error: Error authenticating with Jira: Error: Request failed with status code 404
[2019-09-30 21:43:02:658]  Error: Authentication error: Error authenticating with Jira: Error: Request failed with status code 404

Comments (27)

  1. Daniel Bernard

    Seeing the same issue in beta 3

    [2019-10-03 18:57:42:104] Atlassian for VSCode (v2.0.0-beta3) activated in 17 ms
    [2019-10-03 18:57:42:619] You have gone online!
    [2019-10-03 18:58:30:513]  Error: Error authenticating with Jira: Error: Request failed with status code 404
    [2019-10-03 18:58:30:513]  Error: Authentication error: Error authenticating with Jira: Error: Request failed with status code 404
    

  2. Jeanyhwh Desulme reporter

    Hey Jonathan -

    We unfortunately don’t have any way to set application based passwords since we’re using Azure AD as our Identity Provider. It’s the exact same configuration that we’re using for our Bitbucket Datacenter 6.6 implementation as well. So I find it odd that it works for Bitbucket but not Jira even though both are using the same SAML SSO plugin. The 404 error makes it seem that it’s not even getting to the right url…

    https://marketplace.atlassian.com/apps/1216096/sso-for-atlassian-server-and-data-center?hosting=server&tab=overview

  3. Erik Hess

    The Bitbucket environment I work with uses SAML as well. The 404s in my case were being caused by the fact that the username and the user slug are different. Users with emails as usernames, at least with our SAML provider, have their @ replaced by a _. Thus the 404 Not Found when trying to grab user details instead of the 401 Unauthorized you’d get on a proper credential failure. More details on this are in my big comment on issue #5

    This comment is likely to be irrelevant here after changes made between 2.0.0b2 and the final 2.0.0 release

  4. Jonathan Doklovic Account Deactivated

    It seems like Bitbucket SAML allows you to use basic auth for rest requests seamlessly. Jira does not enable this and is essentially looking into it’s own userbase for a password. Depending on how your Jira is configured, it may be possible to create a password from your Jira profile page. You’d simply login to Jira, go to your profile and see if there’s a “Change Password” option. If so, set one and use it to auth with our extension.

    If this is not an option, the only thing I can think of is adding a feature to the extension to allow the use of custom datacenter/server OAuth tokens. However, this would require considerable work on the Jira admin’s part and we’d have to do a lot of testing around this.

    see: https://developer.atlassian.com/server/jira/platform/oauth/

  5. Jeanyhwh Desulme reporter

    I’m sorry that doesn’t make sense. We have a number of other custom integrations that use’s JIRA’s REST API to create regular Jira issues. They just use a normal user and password to login. Those all bypass the SAML authorization workflow. It should technically be the same I would assume for this plugin.

  6. Erik Hess

    I managed to get this working for the Jira Server instance we have configured using SAML with the following process.

    1. Log out from SAML auth’d session in browser
    2. On login page, click “Can’t access your account?” instead of SAML login link.
    3. Request password change for user
    4. Change password
    5. Log in the user via VSCode extension with the new password

    This allowed the the login process to complete without a 401 or a 404. After this I logged in via browser with the SAML link, closed VS Code and reopened VS Code and the extension is still indicating that its auth’d. 👍

    Its a bit counter-intuitive since I didn’t know until now that Jira maintains a user password even when the user is typically SAML authorized. So this provided a nice, unexpected workaround for the lack of a user-initiated token system like Bitbucket’s “Personal Access Token” which allowed me to get that set up a bit less painfully. 🙂

  7. Jonathan Doklovic Account Deactivated

    @Jeanyhwh Desulme what Erik Hess posted was what I’ve been trying to get at. As long as Jira has a password set for you it will work as it’s just using basic auth. If you have other things working that use basic auth, then the only thing I can think of is to try using https://jira.company.com as the base url instead of ending it with /issues

    Let me know how it goes.

  8. Jeanyhwh Desulme reporter

    Hey @{557057:3695b794-cde3-43a2-99aa-c0fc6151b754} - So I tried to use the VS code plugin again after completely disabling the SAML SSO configuration. At which point all we need to login in to Jira is through normal user credentials. It unfortunately still did not work and I got a 404 error. Your team really needs to support context paths because the only way to access our instance is at https://jira-company.com/issues. We can’t be the only one because Jira previously used to ship with that context as the default url.

    I was even able to reproduce it using vanilla instance of Jira created through docker. After setting it up and accessing it at http://localhost:8080/issues. I would think that this should definitely work seamlessly.

    docker run -e ATL_TOMCAT_CONTEXTPATH=/issues -v jiraVolume:/var/atlassian/application-data/jira --name="jira" -d -p 8080:8080 atlassian/jira-software

  9. Daniel Bernard

    @{557057:3695b794-cde3-43a2-99aa-c0fc6151b754} That prototype worked for me, though I had to enter “jira” as my context path (I’m assuming that’s the configured default context path for my team’s instance; “issues” did not work for me).
    That said, the issues don’t seem to load their content

  10. Jonathan Doklovic Account Deactivated

    @Daniel Bernard With that blank issue screen open, can you use the command palette to open “Web developer tools” and tell me if you see any errors in the javascript console?

  11. Daniel Bernard

    The only entries in the console are “got config event >Object”, no errors to be found.
    Similarly, the Atlassian debug console only contains:

    [2019-10-09 13:34:25:745] Atlassian for VS Code (v2.0.5-cpath) activated in 27 ms
    [2019-10-09 13:34:26:093] You have gone online!
    [2019-10-09 13:34:28:025] Atlassian for VS Code upgraded from v2.0.4 to v2.0.5-cpath
    

    Edit:

    Scratch that, I tried relaunching the developer web console and got:

    vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1 TypeError: Cannot read property 'name' of undefined
        at D (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/viewIssueScreen.68ce062f.chunk.js:1)
        at Ai (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Zo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Vo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Wo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Uo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1
        at t.unstable_runWithPriority (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at dl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at vl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
    Ia @ vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1
    vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1 Uncaught TypeError: Cannot read property 'name' of undefined
        at D (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/viewIssueScreen.68ce062f.chunk.js:1)
        at Ai (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Zo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Vo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Wo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at Uo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1
        at t.unstable_runWithPriority (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at dl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
        at vl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.0.5-cpath/build/static/js/main.2d2c5ec0.js:1)
    

  12. Jonathan Doklovic Account Deactivated

    Ok, I think you may be looking at the wrong panel… VS Code will open debug panels for every extension window that’s open and they all hide each other. I say that because the “got config object” is something that the Atlassian Settings screen prints out, but it shouldn’t be printed on the Issue View screen.

    Can you close all of your tabs, open an issue and open the devtools again and see if you get a different result?

  13. Daniel Bernard

    You were correct, I must have had the wrong panel active. Edited my post above with the error.
    I’m beginning to think this is unrelated to the context issue - I opened an issue in a different project, and it opened fine. The original project that isn’t loading uses some additional customizations. I’m wondering if since we don’t show the Severity field on that project, it’s failing to load some default element?

    That said, I navigated away from the issue *-30, and then back to it, and it’s now failing to load - so maybe I’m just out on a limb.

  14. Jonathan Doklovic Account Deactivated

    @Daniel Bernard We’ve just released 2.1.0 which includes some fixes around reading the field names on the issue screen.

    Can you give this version a shot and let me know if it helps anything?

  15. Daniel Bernard

    Tried, unfortunately the same:

    [2019-10-09 22:07:52:455] Online check attempting to connect to http://atlassian.com
    [2019-10-09 22:07:52:455] Online check attempting to connect to https://bitbucket.org
    [2019-10-09 22:07:53:023] Atlassian for VS Code (v2.1.0) activated in 36 ms
    [2019-10-09 22:07:53:393] Online check connected to https://bitbucket.org
    [2019-10-09 22:07:53:393] You have gone online!
    [2019-10-09 22:07:54:102] Online check connected to http://atlassian.com
    [2019-10-09 22:07:54:215] Atlassian for VS Code upgraded from v2.0.5-cpath to v2.1.0
    
    vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1 TypeError: Cannot read property 'name' of undefined
        at D (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/viewIssueScreen.7ee7f54b.chunk.js:1)
        at Ai (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Zo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Vo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Wo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Uo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1
        at t.unstable_runWithPriority (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at dl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at vl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
    Ia @ vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1
    vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1 Uncaught TypeError: Cannot read property 'name' of undefined
        at D (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/viewIssueScreen.7ee7f54b.chunk.js:1)
        at Ai (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Zo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Vo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Wo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at Uo (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1
        at t.unstable_runWithPriority (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at dl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
        at vl (vscode-resource:/c%3A/Users/<CENSORED_USER>/.vscode/extensions/atlassian.atlascode-2.1.0/build/static/js/main.2594711b.js:1)
    

  16. Jonathan Doklovic Account Deactivated

    @Daniel Bernard hmmm. OK. Well, it seems there’s something the screen doesn’t like with the returned Jira data. Without getting into it, let’s just say “it’s complex”. 🙂

    Do you happen to be familiar with the Charles Web Debugger and would you be willing to help me figure out what’s being returned by Jira?

    If needed you can scrub the data of any actual values and/or we can create a customer service ticket so that our back and forth is secured.

  17. Daniel Bernard

    I can respect that 😉
    I’m not familiar with Charles Web Debugger, but I followed your setup instructions here: https://bitbucket.org/atlassianlabs/atlascode/issues/186/it-looks-like-youve-gone-offline and adjusted the proxy settings to point to my company’s instance, and have a snapshot of a failed issue display; but I’m not sure how to scrub the personal information from the result - is there an easy method to do so? Otherwise, a customer service ticket would be preferred.

  18. Jonathan Doklovic Account Deactivated

    @Daniel Bernard Ok, you can use the feedback button on the Atlassian Settings screen to send any feedback, it’s not important what it is. just “hello” will do. Make sure to check the “Can be contacted” box and put in your actual email. This will create a customer service ticket on our end and you should receive an email with a link to the ticket.

  19. Jeanyhwh Desulme reporter

    Hey @{557057:3695b794-cde3-43a2-99aa-c0fc6151b754} - That seems to have worked out just great for me now. With it enabled I sometimes run into a Cannot read property 'subtasks' of undefined error that just goes away when I hit the refresh button.

  20. Jonathan Doklovic Account Deactivated

    @Jeanyhwh Desulme Thanks for the info! It’s awesome to hear it’s working for you now.

    Can you please open up a new issue for the subtasks error? I’m going to resolve this one.

    Thanks Again!

  21. Log in to comment