Closed catatonicprime closed 4 years ago
Hi @catatonicprime
I think that's a nice idea, could you provide a PR for that?
I can't add a new dependency, too much impact for a low usage, but I would suggest this code:
class KerberosAuth(Authentication):
def signed_session(self, session=None):
session = super(KerberosAuth, self).signed_session(session)
try:
from requests_kerberos import HTTPKerberosAuth
except ImportError:
raise ImportError("In order to use KerberosAuth please do 'pip install requests_kerberos' first")
session.auth = HTTPKerberosAuth()
return session
If you can't that's fine, this issue can become the "official" sample for that :)
Merged
Using kerberos would be extremely useful for riding on one's Single Sign On credentials in domain joined environments to help manage REST services which might already include the consumption of kerberos identities.
I'm no expert in these areas, for sure, but luckily I like to collect from others.
Here's what I've done to get kerberos working in one case but I don't think this is a comprehensive/complete solution that merits a PR just yet. In this case I'm working with azure-devops as a REST server:
pip install --user requests_kerberos
(provided here: https://github.com/requests/requests-kerberos)pip install --user azure-devops
(provided here: https://github.com/Microsoft/azure-devops-python-api)This worked great for me - but I'm not sure what limitations something like this has. Simply it's kind of a hack that works well enough for what I need but it seems like something that may be able to be integrated properly somehow.
What does the team think?