def create_krb_user(username, password, k=None): handle = _pykadm5.init_with_password(kerberosServer["adminUser"], kerberosServer["adminPass"], None, None) t = username + "@" + kerberosServer["realm"] if not t in _pykadm5.get_principals(handle): return _pykadm5.create_principal(handle, username, password, {}) else: return 1
def change_krb_password(username, password): handle = _pykadm5.init_with_password(kerberosServer["adminUser"], kerberosServer["adminPass"], None, None) return _pykadm5.change_password(handle, username, password)
def delete_krb_user(username, k=None): handle = _pykadm5.init_with_password(kerberosServer["adminUser"], kerberosServer["adminPass"], None, None) return _pykadm5.delete_principal(handle, username)