summaryrefslogtreecommitdiffstats
path: root/ipalib/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/util.py')
-rw-r--r--ipalib/util.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index 649a4875f..5a670146e 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -63,15 +63,12 @@ def json_serialize(obj):
def get_current_principal():
try:
- import kerberos
- rc, vc = kerberos.authGSSClientInit("notempty")
- rc = kerberos.authGSSClientInquireCred(vc)
- username = kerberos.authGSSClientUserName(vc)
- kerberos.authGSSClientClean(vc)
- return unicode(username)
+ import gssapi
+ cred = gssapi.Credentials(usage='initiate')
+ return unicode(cred.name)
except ImportError:
- raise RuntimeError('python-kerberos is not available.')
- except kerberos.GSSError, e:
+ raise RuntimeError('python-gssapi is not available.')
+ except gssapi.exceptions.GSSError:
#TODO: do a kinit?
raise errors.CCacheError()