Skip to content

Switching from identity.web to identity.flask with multiple hosts? #63

@hj115274

Description

@hj115274

I have a flask app with multiple valid hostnames. They are all registered in the Entra 'valid callback' list. In the old version of this app (with identity.web), my code rendered the login form, and I could use

        redirect_uri=url_for("aad_auth_response", _external=True),

and _external=True would add the correct host for the current request.

In the new version (identity.flask), I create an Auth() object during app startup and then auth.init_app(app). This is before any requests, so it can't know the hostname. The result is that some requests get redirected to the other hostname, and in the process lose their after_login information, so deep-links end up pointing at the front page of the app.

Is there a way to work around this? I really want to set redirect_uri during the login flow. Is that possible?

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