-
Notifications
You must be signed in to change notification settings - Fork 73
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
Authentication with Delegated Credentials #205
Comments
If you have a credential in the ccache then this library should be able to use those credentials if no username/password is set. I use it all the time to do things like For this to work you do need the optional Kerberos Python libraries to be installed which on Linux is currently The part I'm not played around with is delegated credentials. If these delegated credentials are in the ccache and you can do things like |
Thanks for the quick response. The situation as I understand is that delegated credentials is supported in some packages (such as smbclient) but not others (such as kvno).
I think it is the libraries that are different between smbclient and kvno. When I issue: I get:
When I issue: I get:
I hope that was a bit helpful. |
Are you able to share your full workflow with The
Makes some sense, the default Kerberos library used on most Linux distributions is MIT krb5 while Samba usually compiles against their own fork of Heimdal. If you search Now it is perfectly possible to have the Kerberos dependencies of this library compile against the Heimdal libs instead of MIT krb5 but the method of doing so depends on a few things. Currently the Python modules are looking up To get it to use Heimdal instead you'll need to ensure that the Heimdal python3 -m venv smb-test
source smb-test/bin/activate
python -m pip install -U pip setuptools
KRB5_KRB5CONFIG=/usr/bin/krb5-config.heimdal GSSAPI_KRB5CONFIG=$KRB5_KRB5CONFIG python -m pip install smbprotocol[kerberos] --no-cache-dir Note: I'm using a venv to ensure I have the latest pip and setuptools and a way to blow away the changes without affecting the system. The env vars should work for a normal pip install with these libs but mileage may vary based on your pip/setuptools version. Things may also fail to install depending on the compiler. Using Heimdal with this library is definitely an edge case and not the standard scenario. You can verify if it compiled against Heimdal instead of MIT by checking the paths on the following: ldd "$(python -c 'import gssapi; print(gssapi.raw.sec_contexts.__file__)')"
ldd "$(python -c 'import krb5; print(krb5._context.__file__)')" There's no guarantee that this will automatically pick up the cached credential though. Maybe it's a Heimdal specific feature or maybe Samba's smbclient is doing something special that I'm not aware of. Knowing your workflow might help me to replicate it and potentially see what is happening. |
Thanks for the tip. I will work on it and get back here. I hope it will help future generations :D |
We use delegated credentials in our jupyter server, I would like to be able to use the cached credentials to be able to authenticate with smb server.
Other methods seem to work fine (e.g.: !smbclient) but smbclient protocol does not seem to handle this use case. Is there any guidance on this?
The text was updated successfully, but these errors were encountered: