-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
The user is not redirected to a microsoft page #258
Comments
By default the django admin URL won't be overriden. You would need to do that in your urls.py file specifically. If you install django-extensions and run |
OK, what exactly do I have to do? I just want that people can log in to django admin. They must somehow be redirected to some microsoft site by django I think. How to achieve this? |
You need to define a URL to catch the requests to your admin login flow. The default would be:
Where from django.conf import settings
from django.contrib.auth.views import LoginView
from django.shortcuts import redirect, render
from django.urls import reverse
def admin_login_redirect(request):
"""Redirect the admin login to our auth login."""
next = request.GET.get(LoginView.redirect_field_name, reverse("admin:index"))
return redirect(settings.AUTH_URL + f"?next={next}") |
Ok, I did that.
The ordering seems to matter. It now says that I have not set AUTH_URL in settings. What value do I have to set AUTH_URL to? Haven't found anything about AUTH_URL in your doku: https://django-auth-adfs.readthedocs.io/en/latest/search.html?q=AUTH_URL&check_keywords=yes&area=default |
Oh, sorry about that. That's a relic of my system allowing us to programatically switch between direct auth and active directory SSO. Rather than |
I was now redirected to a microsoft login page correctly and was able to log in: What is your plugin trying to do and what permissions are needed. |
Please review the documentation. You should have an idea of what the purpose of the library is if you're trying to integrate it.
You identified the missing permissions in the URLs. Additionally, you can review the config guides in the docs and the demo app. |
ok, the Azure AD Admin has changed something for me. The URL looks now different.
Login Failed is displayed and in the log I see:
(I have changed some numbers) How to debug this further? How to find the problem? |
about this issue, you could ref the last section of step-3-register-and-configure-an-azure-ad-frontend-application But for me, some typical case, can we add groups claim in frontend app, aims to limit user group number when generating token as workaround? |
Hi,
I use Azure AD. I configured everything like I thought it would work. I opened the django admin site. I typed in my credentials and it said wrong credentials... But I thought it should redirect me to a microsoft site to perform login? Why is Django even asking me for credentials?
The text was updated successfully, but these errors were encountered: