chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

login-callback looping with Azure AD OAuth in combo with fastapi mount_chainlit

Open weipienlee opened this issue 1 year ago • 1 comments

We have a custom linux python container Azure web app with our own AAD login mechanism but the same app registration used for the chainlit part.

  • We used mount_chainlit to mount it to a "deeper" path
  • set CHAINLIT_URL to the base url of our web app
  • set the OAUTH_AZURE_* and CHAINLIT_AUTH_SECRET

There are unexpected behaviours in different situations:

  • incognito mode
    • login flow seems to work
    • most of the time the app has been partially loaded e.g. on_chat_start not triggered (after refresh it will)
    • whether I'm logged on our "host" app doesn't matter
  • non-incognito mode
    • with all data/cookies deleted it behaves as incognito, as expected
    • go directly to chainlit path
      • the login flow seems to work and only sometimes the app is fully loaded (same above no e.g. no on_chat_start)
      • several times refresh could load the complete app
    • when logged in on the "host" app
      • going directly to the chainlit path after that, triggers a seemingly login-callback loop with serveral intermediate steps
      • it seems to "give up" after several attempts
      • I got a hunch its related to the auto login somehow, which also see appearing

NOTE: when deploying the same isolated chainlit code to a dedicated linux python Azure web app, it all works.

Firefox (also with incognito) chainlit version: 1.1.400rc1

weipienlee avatar Jul 18 '24 15:07 weipienlee

Solved in release candidate

weipienlee avatar Jul 21 '24 15:07 weipienlee

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Jul 23 '25 02:07 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Jul 30 '25 02:07 github-actions[bot]