-
Notifications
You must be signed in to change notification settings - Fork 11
Kerberos Login #22
Comments
I got this error when using httpclient, like this:
After fixing the MechType check as was described above, I still get an error: |
I am also encountering this issue. Steps to Reproduce
The contents of
I'm a noob to Kerberos, so I'm sure I'm doing something incorrectly, but I don't know what... :-) Any tips appreciated. I'll keep poking at it and post or PR if I make any headway. |
Seeing the same using requests-kerberos and the newer requests-gssapi (on CentOS 7.x so the versions are a little outdated, though I also see the same in a virtualenv with the latest versions) from __future__ import print_function
import gssapi
import logging
import requests
from requests_gssapi import HTTPSPNEGOAuth, DISABLED
logging.basicConfig()
logger = logging.getLogger('requests_gssapi')
logger.setLevel(logging.DEBUG)
vhost = "vault.domain"
preempt = True
target=gssapi.Name("HTTP@{0}:8200".format(vhost), gssapi.NameType.hostbased_service)
auth = HTTPSPNEGOAuth(mutual_authentication=DISABLED, opportunistic_auth=preempt, target_name=target)
r = requests.post("https://{0}:8200/v1/auth/kerberos/login".format(vhost), auth=auth, verify='/etc/pki/tls/cert.pem')
print(r.__dict__) Gives
|
I made some progress on this. Summary of my research in case it helps anyone else.
This patch for requests-gssapi is just a PoC, but demonstrates SPNEGO support working when hardcoded in:
And the shortest working client code for this: from __future__ import print_function
import gssapi
import requests
from requests_gssapi import HTTPSPNEGOAuth, DISABLED
vhost = "vault.domain:8200"
auth = HTTPSPNEGOAuth(target_name=gssapi.Name("HTTP@{0}".format(vhost), gssapi.NameType.hostbased_service))
r = requests.post("https://{0}/v1/auth/kerberos/login".format(vhost), auth=auth, verify='/etc/pki/tls/cert.pem')
print(r.__dict__) In lieu of RFC4178 changes being included in a released version of spnego = gssapi.OID.from_int_seq("1.3.6.1.5.5.2") And a PR for proper support in requests-gssapi module for passing the mech through is in pythongssapi/requests-gssapi#19. |
I'm also getting this issue attempting a naïve connection from Chrome running on Windows 10 to the example HTTP server. |
@tomqwpl please note that this repo has moved to here: https://github.com/hashicorp/vault-plugin-auth-kerberos. I also no longer maintain this repo, or the other, but I noticed your comment and wanted to point you in the right direction. If this issue isn't open there, you may want to open it to alert the current maintainers. |
When I try to login via SPNEGO I got following error:
{"errors":["SPNEGO OID of MechToken is not of type KRB5"]}
When I look via WireShark in my request there are 4 mechTypes:
Seems like only the first one is checked.
The text was updated successfully, but these errors were encountered: