Issues with Azure AD Authentication in Reflex Deployed to Azure Container Apps #5132
Unanswered
RandomBrown
asked this question in
Q&A
Replies: 1 comment
-
|
Can you confirm that your ASGI app (fastAPI) has this endpoint /auth/callback defined? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
According to my company's policies, I am deploying a Reflex application running as a container in Azure Container Apps, exposing a single port to the internet.
I’ve followed this guide for the setup:
https://azureossd.github.io/2024/08/24/Deploying-Reflex-Application-to-Azure-Container-Apps/
Here’s my Dockerfile:
My Caddyfile before enabling authentication with Azure AD looked like this:
And now, with authentication, it’s configured like this (observe the path to authentication pages):
Everything worked smoothly during the development phase. However, now that I’m in production, I’ve encountered an issue.
I added Azure AD authentication to my Reflex app using this tutorial:
https://reflex.dev/blog/2024-11-19-microsoft-azure-authentication/
When running the app locally on my development machine, everything functions perfectly. Azure AD authentication works as expected.
However, when I deploy the container to Azure Container Apps and try logging in, authentication fails.
Checking Caddy’s logs, it seems to process the request and redirect correctly:
{ "level": "error", "ts": 1744721074.1756198, "logger": "http.log.access.log0", "msg": "handled request", "request": { "remote_ip": "100.100.0.59", // ... "method": "GET", "host": "xxxx.xxxx.northeurope.azurecontainerapps.io", "uri": "/auth/callback?code=1.AXkAnz...&state=jQVBsdfssPWlcwrqknOX&session_state=003ee5a9...", // ... }, "user_id": "", "duration": 0.001894398, "size": 22, "status": 404, "resp_headers": { "Date": ["Tue, 15 Apr 2025 12:44:33 GMT"], "Server": ["Caddy", "uvicorn"], // <-- Important! "Content-Length": ["22"], "Content-Type": ["application/json"] } }Despite this, I receive a 404 error, likely returned by Uvicorn, and it occurs very quickly.
Can someone help me figure this out? Or at least point me in the direction of where the issue might be happening?
Can anyone help me pinpoint the issue? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions