Skip to content

Not working for multiple workers by uvicorn #48

@maveius

Description

@maveius

Describe the bug
Did anyone tried to use it for multiple workers >1 like 4 ?
uvicorn app.main:app --host 0.0.0.0 --port 8001 --workers 4
When multiple workers by uvicorn I think that different sub-processes are inside and session is not shared between workers (processes) then issue like detail
"AADSTS501481: The Code_Verifier does not match the code_challenge supplied in the authorization request. Trace ID:..."

To Reproduce
Steps to reproduce the behavior:

  1. Run in docker by uvicorn app with workers 4 uvicorn app.main:app --host 0.0.0.0 --port 8001 --workers 4
  2. Click on login button
  3. Wait for result
  4. See error "AADSTS501481: The Code_Verifier does not match the code_challenge supplied in the authorization request. Trace ID:..."

Expected behavior
It should not depend on which worker has this code in memory in one single session, but should share between processes.

Environment Settings

  • OS: Linux / Docker (python:3.12)
  • Python Version: 3.12
  • Package Versions:
  • msal: 1.32.3
  • fastapi: 0.115.13
  • fastapi_msal: 2.1.7

Additional context

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