Skip to content

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

Closed

Description

@skapis

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?

Activity

  1. 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[/+] on May 19, 2024
  2. added a commit that references this issue on May 26, 2024
    82ac09f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions