I'm new here. It's the same question as this one, but I didn't get answer so I post it again: how to create a ticket in rt using python-rtkit
I tried both CookieAuthenticator
and BasicAuthenticator
to create or read ticket but I still get the same error:
`RT/3.8.13 401 Credentials required`
When I load the url directly in the browser: http://ticket.corp.kk.net/REST/1.0/ticket/214560?user=user&pass=pass, I DO get the ticket content in the browser.
I even tried the wget
command to get one ticket content as below using cookie, and it works well:
save manually the cookie value in the
coookie.txt
file:RT_SID_kk.net.80=5a1c1eb207c4e2ef5af726e98d751a08
run this command:
wget -O ticketContent.txt --keep-session-cookies --save-cookies cookies.txt 'http://ticket.corp.kk.net/REST/1.0/ticket/220680/show?format=l&user=user&pass=pass'
The ticket content is well registered in ticketContent.txt
, which is showing using the cookie to authenticate is working.
But I still can not go through CookieAuthentication
of rtkit in my python script.
I've been struggling on this problem for 2 days, I would deeply appreciate it if someone can help me out. Thank you.
I haven't found a solution for this problem , but I succeeded to use python Requests library to create a ticket in RT .
create a new ticket in RT
The output is:
Hope this can help you , if you have the same problem as me . :-)