02strich / django-auth-kerberos

Kerberos authentication backend for Django
MIT License
19 stars 12 forks source link

Permission denied #12

Closed nidhirbstpl closed 6 years ago

nidhirbstpl commented 6 years ago

I'm getting a permission denied error when trying to authenticate a user:

from django.conf import settings from django_auth_kerberos.backends import KrbBackend kerb = KrbBackend() result = kerb.authenticate(settings.KRB5_TEST_USER,settings.KRB5_TEST_PASSWORD) Failure during authentication Traceback (most recent call last): File "/var/www/adlm_python/venv/lib/python3.4/site-packages/django_auth_kerberos/backends.py", line 60, in check_password kerberos.checkPassword(username.lower(), password, getattr(settings, "KRB5_SERVICE", ""), getattr(settings, "KRB5_REALM", ""), getattr(settings, "KRB5_VERIFY_KDC", True)) kerberos.BasicAuthError: ('Permission denied', 13)

Here is my settings.py file:

INSTALLED_APPS= [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'users', 'project', 'rest_framework', 'rest_framework.authtoken', 'corsheaders', 'kronos', 'django_auth_kerberos', ] KRB5_REALM = "****" KRB5_SERVICE = '****' KRB5_DEBUG = True KRB5_VERIFY_KDC = True KRB5_USERNAME_MATCH_IEXACT = True LOGIN_REDIRECT_URL = '/' AUTHENTICATION_BACKENDS = ( 'django_auth_kerberos.backends.KrbBackend', ) KRB5_TEST_USER = '***' KRB5_TEST_PASSWORD = '*'`

02strich commented 6 years ago

This means the KDC returns with a permission denied. Does this login work otherwise on the same system?

nidhirbstpl commented 6 years ago

I tried knit and klist and it worked.

02strich commented 6 years ago

Can you try with KRB5_VERIFY_KDC = false? Also can you try removing KRB5_SERVICE?

nidhirbstpl commented 6 years ago

Hey that worked! Thanks.