Open bendemott opened 3 years ago
Hi @bendemott
After rethinking of this issue, IMO, this error should be an actual problem you should have to handle. That means, krbContext should not overwrite an existing credential which has a valid ticket with different principal. This could avoid any potential problem due to the change to the credential by accident.
The code near line
156
incontext.py
attempts to get existing credentials before it creates a temporary credentials cache for keytab auth.The above line triggers the following error:
You can recreate this error by simply:
kinit user1
user2
withuser2.keytab
. Passing the principal=user2
This error occurs because when gssapi looks into the existing cache with a credential of
user
and cannot finduser2
. There just needs to be a try/catch around this line to resolve the issue.