You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many apps require authentication to manage users. There are a few different ways to accomplish this in Reflex:
4
8
5
-
We have solutions here:
9
+
We have solutions that currently exist outside of the core framework:
6
10
7
-
1. Local Auth: Uses your own database: https://github.com/reflex-dev/reflex-examples/tree/main/twitter
8
-
2. Google Auth: Uses sign in with Google: https://reflex.dev/blog/2023-10-25-implementing-sign-in-with-google/
11
+
1. Local Auth: Uses your own database: https://github.com/masenf/reflex-local-auth
12
+
2. Google Auth: Uses sign in with Google: https://github.com/masenf/reflex-google-auth
9
13
3. Captcha: Generates tests that humans can pass but automated systems cannot: https://github.com/masenf/reflex-google-recaptcha-v2
10
14
4. Magic Link Auth: A passwordless login method that sends a unique, one-time-use URL to a user's email: https://github.com/masenf/reflex-magic-link-auth
11
15
5. Clerk Auth: A community member wrapped this component and hooked it up in this app: https://github.com/TimChild/reflex-clerk-api
12
16
17
+
## Guidance for Implementing Authentication
18
+
19
+
- Store sensitive user tokens and information in [backend-only vars]({vars.base_vars.path}#backend-only-vars).
20
+
- Validate user session and permissions for each event handler that performs an authenticated action and all computed vars or loader events that access private data.
21
+
- All content that is statically rendered in the frontend (for example, data hardcoded or loaded at compile time in the UI) will be publicly available, even if the page redirects to a login or uses `rx.cond` to hide content.
22
+
- Only data that originates from state can be truly private and protected.
23
+
- When using cookies or local storage, a signed JWT can detect and invalidate any local tampering.
24
+
13
25
More auth documentation on the way. Check back soon!
0 commit comments