kinit¶
- igwn_auth_utils.kinit(principal=None, keytab=None, ccache=None)¶
Initialise a Kerberos ticket-granting ticket (TGT).
The method works in the same way as the
kinitcommand-line tool, with the caveat that it only works with Kerberos keytab files, and does not support interactive input of principal passwords.- Parameters:
principal (
str, optional) – Principal name for Kerberos credential. If not given it will be taken from thekeytab. Ifprincipalis not specified in the formname@REALMthe default realm REALM will be applied, seeman krb5.conf(5).keytab (
str, optional) – Path to keytab file. Default taken fromKRB5_KTNAMEenvironment variable. This option is required to be notNone.ccache (
str, optional) – Path to Kerberos credentials cache.
Examples
When
KRB5_KTNAMEenvironment variable is set, this function can operate with no arguments:>>> kinit()
If the Kerberos config (
krb5.conf) has a default realm configured, theprincipalcan be specified without that component:>>> kinit("albert.einstein")