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

Authentication Error Due to Redirect URI Mismatch When Using login_required in Django App #26

Closed
skapis opened this issue May 19, 2024 · 0 comments

Comments

@skapis
Copy link

skapis commented 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

image

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?

@skapis 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
@rayluo rayluo closed this as completed in 82ac09f May 26, 2024
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

1 participant