-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to get request headers in the frontend #2704
Comments
Just found this: https://reflex.dev/docs/utility_methods/router_attributes/ It looks like all request headers should be accessible there. However, I'm still having trouble with passing request headers that come from the front end to the backend. As background, I am hosting Reflex in Azure using web apps. I created two webapps: one for the frontend, one for the backend. Then I added Authentication. The Web App makes the authenticated user information available as injected headers. The problem is that the authentication happens in the frontend web app so that's where the request headers are. I tried adding the auth to the backend, but it doesn't redirect traffic properly so the connection just fails. So I need a way to pass the request headers that the front end receives to the backend. But because the router approaches all work with |
I've been using MSAL to authenticate users of my reflex site for a while now. Here is the code I use. State code:
page code:
|
When hosting reflex in Azure Web Apps you can use built in authentication providers. This also gives you access to the relevant tokens for any of those services, but to access them you need access to the request headers (see here).
It would be great to be able to access those request headers for example in a
rx.State
variable.The text was updated successfully, but these errors were encountered: