]> git.ipfire.org Git - ipfire.org.git/commitdiff
accounts: Use a custom keytab to authenticate users
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Jan 2024 17:51:10 +0000 (17:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Jan 2024 17:51:10 +0000 (17:51 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/accounts.py

index a92bc338f59d097fd7cd7886b43bb1091a3fa409..9df7d627acd8ff02be20ac8c0f859a4ae5098049 100644 (file)
@@ -758,9 +758,12 @@ class Account(LDAPObject):
 
                logging.debug("Checking credentials for %s" % self.dn)
 
+               # Set keytab to use
+               os.environ["KRB5_KTNAME"] = "/etc/ipfire.org/www.keytab"
+
                # Check the credentials against the Kerberos database
                try:
-                       kerberos.checkPassword(self.uid, password, "host/%s" % FQDN, "IPFIRE.ORG")
+                       kerberos.checkPassword(self.uid, password, "www/%s" % FQDN, "IPFIRE.ORG")
 
                # Catch any authentication errors
                except kerberos.BasicAuthError as e: