requests / requests-kerberos

An authentication handler for using Kerberos with Python Requests.
Other
289 stars 101 forks source link

Possible to have a callback (for me to kinit) if a ticket is deemed to have expired? #155

Open csm10495 opened 4 years ago

csm10495 commented 4 years ago

The code here makes it pretty difficult to know if authentication is likely to fail due to ticket expiration. https://github.com/requests/requests-kerberos/blob/d9c78fc3040481bf944306193ee5564ae6c4de31/requests_kerberos/kerberos_.py#L262

Is there any way that I can catch this error and do a kinit or something?

Right now I'm just looking for a 401, and doing a kinit, though optimally requests-kerberos could somehow percolate the error i see in logs: kerberos.GSSError: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Ticket expired', -1765328352)) to me. Thanks!