service_name = gssapi.Name('HTTP@%s' % host, gssapi.C_NT_HOSTBASED_SERVICE)
spnegoMechOid = gssapi.oids.OID.mech_from_string('1.3.6.1.5.5.2')
ctx = gssapi.InitContext(service_name, mech_type=spnegoMechOid)
out_token = ctx.step(in_token)
SPNEGO (kerberos token generation/validation) for SSO using Python