marc0l92 / obsidian-jira-issue

This plugin allows you to track the progress of Atlassian Jira issues from your Obsidian notes.
https://marc0l92.github.io/obsidian-jira-issue/
GNU Affero General Public License v3.0
234 stars 36 forks source link

403 when using inline or code block jira-issue #17

Closed tommyli123 closed 2 years ago

tommyli123 commented 2 years ago

Basic authentication seems working. I verified with a wrong password that it is returning 401 as expected. However, with correct credential. it returns 403 when using inline JIRA: or with code block ```jira-issue

I verified the link generated by the plugin is correct. ie. JIRA:XXX-123 it is generated as "myjiradomain"/browse/XXX-123

marc0l92 commented 2 years ago

Are you able to get the response body from this request? Otherwise I could deliver a new version of the plugin that some additional debug information in the console so you can help me understand the issue

tommyli123 commented 2 years ago

I cleared the console and retry adding JIRA: as well as code block. Both failed with 403, and console doesn't show any exceptions. I am not able to get the response body from the request.

marc0l92 commented 2 years ago

I created a new release 1.21.1 that prints the response payload when there is an error. Can you update the plugin and check the response in the console? You can open the console with Ctrl+Shift+i

tommyli123 commented 2 years ago

Installed 1.21.1

[Exception: SyntaxError: Unexpected token < in JSON at position 11 at JSON.parse () at Object.get json [as json] (app://obsidian.md/app.js:1:1505610) at Object.r (:1:83)]

marc0l92 commented 2 years ago

So the api is returning an HTML page. I will have to add another log so you can tell me what is the content of this page. I will let you know when you can do another test

tommyli123 commented 2 years ago

In my case, the REST api to get the json payload by jira key is "myjiradomain"/rest/api/latest/issue And, for search it is "myjiradomain"/rest/api/2/search? If your plugin can allow specifying that in settings (to override your defaults) that will work.

marc0l92 commented 2 years ago

The plugin uses the same api you described

marc0l92 commented 2 years ago

I delivered version 1.21.2 that logs the content of every request and response that this plugin does. Please update your plugin and let me know if you find something wrong in the API call or if you see something useful in the error response.

It would be really helpful to share the request and response, but I understand that they contain confidential information. So I cannot help you more than this.

tommyli123 commented 2 years ago

installed 1.21.2. With the full response, I find out there is an internal authentication issue. Working with our support, the issue is resolved.

Your plugin works like magic now! (have to restart obsidian though, i suspect there is is some caching linger on).

Thanks for your help. We can resolve this issue.

marc0l92 commented 2 years ago

I'm happy that you manage to fix the authentication issue. I will create a setting to enable/disable the logging of requests and responses so it can be easily investigated next time.

If you want you can support this project with a donation HERE.