Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django admin not working when AUTHENTICATION_BACKENDS not set properly #50

Open
kristall opened this issue Sep 25, 2020 · 2 comments
Open

Comments

@kristall
Copy link

Under https://django-keycloak.readthedocs.io/en/latest/index.html#setup is the point

AUTHENTICATION_BACKENDS = [
   ...
   'django_keycloak.auth.backends.KeycloakAuthorizationCodeBackend',
]

but in an "vanilla" settings file is no AUTHENTICATION_BACKENDS so the ... need to be replace with the default value (see https://docs.djangoproject.com/en/3.1/ref/settings/#auth): 'django.contrib.auth.backends.ModelBackend',, so that it looks like this

AUTHENTICATION_BACKENDS = [
    'django.contrib.auth.backends.ModelBackend',
    'django_keycloak.auth.backends.KeycloakAuthorizationCodeBackend',
]

else the django superuser can not login to the django admin. I banged my head for 2 hours against that, so I leave a clue here for others ...

@cjy543731778
Copy link

Under https://django-keycloak.readthedocs.io/en/latest/index.html#setup is the point

AUTHENTICATION_BACKENDS = [
   ...
   'django_keycloak.auth.backends.KeycloakAuthorizationCodeBackend',
]

but in an "vanilla" settings file is no AUTHENTICATION_BACKENDS so the ... need to be replace with the default value (see https://docs.djangoproject.com/en/3.1/ref/settings/#auth): 'django.contrib.auth.backends.ModelBackend',, so that it looks like this

AUTHENTICATION_BACKENDS = [
    'django.contrib.auth.backends.ModelBackend',
    'django_keycloak.auth.backends.KeycloakAuthorizationCodeBackend',
]

else the django superuser can not login to the django admin. I banged my head for 2 hours against that, so I leave a clue here for others ...

Thank you very much.

@bowerta
Copy link

bowerta commented Nov 23, 2020

Under https://django-keycloak.readthedocs.io/en/latest/index.html#setup is the point

AUTHENTICATION_BACKENDS = [
   ...
   'django_keycloak.auth.backends.KeycloakAuthorizationCodeBackend',
]

but in an "vanilla" settings file is no AUTHENTICATION_BACKENDS so the ... need to be replace with the default value (see https://docs.djangoproject.com/en/3.1/ref/settings/#auth): 'django.contrib.auth.backends.ModelBackend',, so that it looks like this

AUTHENTICATION_BACKENDS = [
    'django.contrib.auth.backends.ModelBackend',
    'django_keycloak.auth.backends.KeycloakAuthorizationCodeBackend',
]

else the django superuser can not login to the django admin. I banged my head for 2 hours against that, so I leave a clue here for others ...

Thanks, this was helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants