You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing an issue accessing a specific view in my Django application as a non-logged-in user. This view is decorated with login_required. After filling in the username and password, there is an authentication error because the redirect URI does not match the redirect URI configured in Azure.
I believe the problem lies in the login function in the Auth class, as the redirect URI is being built from the request, and the redirect URI from the environment variable is no longer being used.
Expected behaviour
The redirect URI should be constructed solely from the environment variable and should not be generated from the request.
Actual behaviour
The redirect URI is being constructed from the request, leading to a mismatch with the redirect URI in Azure and consequently causing an authentication error.
Is there a way to override this part of the code so that the redirect URI is not built from the request but only from the environment variable?
The text was updated successfully, but these errors were encountered:
skapis
changed the title
How to configure redirect url in login_required decorator
Authentication Error Due to Redirect URI Mismatch When Using login_required in Django App
May 19, 2024
I am experiencing an issue accessing a specific view in my Django application as a non-logged-in user. This view is decorated with login_required. After filling in the username and password, there is an authentication error because the redirect URI does not match the redirect URI configured in Azure.
Redirect URI in Azure: http://localhost:5000/redirect
I believe the problem lies in the login function in the Auth class, as the redirect URI is being built from the request, and the redirect URI from the environment variable is no longer being used.
Expected behaviour
The redirect URI should be constructed solely from the environment variable and should not be generated from the request.
Actual behaviour
The redirect URI is being constructed from the request, leading to a mismatch with the redirect URI in Azure and consequently causing an authentication error.
Is there a way to override this part of the code so that the redirect URI is not built from the request but only from the environment variable?
The text was updated successfully, but these errors were encountered: