nyyManni / jiralib2

Lisp bindings to JIRA REST API (used by Ejira)
GNU General Public License v3.0
21 stars 21 forks source link

jiralib2 queries API as anonymous user even after I login #8

Closed romariorios closed 3 years ago

romariorios commented 3 years ago

This is my setup:

(require 'use-package)
(use-package jiralib2
  :init
  (setq jiralib2-url jira-server
        jiralib2-auth 'basic
        jiralib2-user-login-name user
        request--curl-cookie-jar "")) ; following troubleshooting tip at README
                                      ; (it didn't work)

When I try to perform a query with jiralib2-jql-search, the following happens:

  1. Jiralib asks me for my password
  2. I get an error 400 and the following response from the API:
    user-error: Request failed: invalid request:
    ((errorMessages
    Field 'assignee' does not exist or this field cannot be viewed by anonymous users.
    Field 'issuetype' does not exist or this field cannot be viewed by anonymous users.)
    (errors))

My current workaround is switching back and forth from 'basic to 'cookie and running M-x jiralib2-session-login until the query works (it usually takes one back and forth).

Any idea of what's going on?

romariorios commented 3 years ago

Update: it seems leaving jiralib2-auth as 'cookie now works? Not sure if that has anything to do with the (setq request--curl-cookie-jar "") workaround.

I'll be back in a few days and close this issue if it keeps working.

romariorios commented 3 years ago

I think keeping the cookie authentication and setting request--curl-cookie-jar worked? I no longer have any authentication issues.

Closing this.