Hello,
I am writing a python program in which I am authenticating myself to Jira using
jira = JIRA(server="https://jira-pd.mycompany.biz", token_auth="{mytoken}")To keep track on tokens I want to print out information about the token used, specifically "name" and "expiringAt" which can be retrieved from "rest/pat/latest/tokens". I tried to write a function doing this:
def get_token_info():
url = "https://jira-pd.mycompany.biz/rest/pat/latest/tokens"
payload = {"name": "value1", "expiringAt": "value2"}
r = requests.get(url, params=payload)
print(r.text)
This function returns a 401 status saying "Client must be authenticated to access this resource". I suspect that the get-function does not align well with the Jira package, as the package seems to be constructed to handle Jira issues and doesn't incorporate get().
Worth mentioning is that I have tried other methods of authentication (HTTPBasicAuth and OAuth2) which I didn't get to work. My code also involves retrieving issue-data which has been easily handled using the Jira package, so I would prefer if I could keep my current authentication method.
How can I go about this issue?