-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support collection credential caches #15
Comments
Ahh I see, |
Indeed, alhough it does probably make it harder (or impossible) to check for credential expiry upfront. |
I don't think that matters as much, the expiry check is mostly a historical thing where the original code checked if the cache was expired and had a fallback to the explicit credentials if passed in. Now it will always favour the explicit credentials so that's no longer relevant and if it's expired it will just fail when attempting the auth anyway. |
When you get a chance are you able to test out #16 to verify that it works as you expect? |
Thanks, it seems to be working as expected (tested on top of main). |
Thanks for confirming! |
In MIT Kerberos (and probably also Heimdal), the
DIR:
andKCM:
credential cache types support multiple sets of credentials, e.g. TGTs and tickets for completely disjoint realms. When GSSAPI isn't given any specific credentials it'll choose the correct ones based on the server principal (either by matching the realm, or by custom rules in ~/.k5identity).However, when spnego/gss.py in _get_gssapi_credential() explicitly retrieves the credentials, it always gets those from the "primary" cache in the collection (chosen using
kswitch
, but by default it's the last one that was kinit'd). This makes it difficult to authenticate against servers in non-primary realms, unless I manually kswitch to the correct principal – which rather defeats the point of using "collection" types. (I wanted to migrate from mykc
script that switches between several file-based caches...)It seems that everything works as expected if I patch
_get_gssapi_credential()
to simply returnNone
when the mechanism is Kerberos, the usage is "initiate", and the username/password aren't provided. I believe the module should do that and not try to pass explicit credentials if the user isn't specifying any.Rough steps for using collection caches:
The text was updated successfully, but these errors were encountered: