snok / django-auth-adfs

A Django authentication backend for Microsoft ADFS and AzureAD
http://django-auth-adfs.readthedocs.io/
BSD 2-Clause "Simplified" License
272 stars 99 forks source link

why i can't login through admin panel. #222

Closed OleksandrSotsenko closed 2 years ago

OleksandrSotsenko commented 2 years ago

When I try to login to the admin panel, I get an invalid username or password warning, but I enter the correct username and password. I would also like to know if I can use the standard authentication and the one you provide together?

tim-schilling commented 2 years ago

I think you may have disabled the default authentication backend. What is your AUTHENTICATION_BACKENDS setting?

And yes, you can use both if you specify both authentication backends. You can read more on how that works in the Django docs. If you have specific questions after that, let us know!

jamesgrogantech commented 2 years ago

Thanks @tim-schilling I couldn't work this one out and had the same issue as @SashaSotsenko as soon as you add

AUTHENTICATION_BACKENDS = (
    'django_auth_adfs.backend.AdfsAuthCodeBackend',
)

it overides the default setting. This is how I have set mine now:

AUTHENTICATION_BACKENDS = (
    'django_auth_adfs.backend.AdfsAuthCodeBackend',
    'django.contrib.auth.backends.ModelBackend',
)
tim-schilling commented 2 years ago

Closing issue due to lack of response from OP and clear solution from @jamesgrogantech (thanks!)