# Password Protection Setup (No HF Account Required) ## ✅ Solution: Gradio Built-in Authentication **Good news**: You don't need to build your own frontend! Gradio has built-in password protection that works without Hugging Face accounts. ## How It Works - Users visit your Space URL - They see a login screen (username/password) - No Hugging Face account needed! - Simple and secure ## Setup Steps ### Step 1: Update app.py The code is already updated! Just change the password: ```python demo.launch( auth=("starflow", "your-password-here"), # Change this! share=False ) ``` ### Step 2: Set Your Password 1. **Edit app.py** in your Space (or locally and push) 2. **Change**: `"your-password-here"` to your actual password 3. **Save and push** ### Step 3: Share Access **Option A: Single Username/Password** ```python auth=("starflow", "my-secure-password") ``` - Everyone uses same login - Simple to share **Option B: Multiple Users** ```python auth=[ ("user1", "password1"), ("user2", "password2"), ("user3", "password3") ] ``` - Different login for each person - More control ## Usage 1. **Make Space Public** (so anyone can access the URL) - Settings → Visibility → Public - Or keep Private (only collaborators see it) 2. **Share the Space URL**: - https://huggingface.co/spaces/GlobalStudio/starflow 3. **Users visit URL**: - See login screen - Enter username/password - No HF account needed! - Access granted ✅ ## Security Tips - ✅ Use strong passwords - ✅ Change password regularly - ✅ Don't share password publicly - ✅ Use different passwords for different users (if using multiple) ## Alternative: Environment Variables (More Secure) For better security, use environment variables: ```python import os username = os.getenv("STARFLOW_USERNAME", "starflow") password = os.getenv("STARFLOW_PASSWORD", "default-password") demo.launch(auth=(username, password)) ``` Then set in Space Settings → Variables: - `STARFLOW_USERNAME` = your-username - `STARFLOW_PASSWORD` = your-password ## Benefits ✅ **No HF account needed** - Users just need password ✅ **Simple** - Built into Gradio ✅ **Secure** - Password protected ✅ **Easy to manage** - Change password anytime ✅ **No custom frontend** - Uses existing Gradio UI ## Summary **You DON'T need to build your own frontend!** Just: 1. Add password to app.py 2. Make Space Public (or keep Private + share URL) 3. Share URL + password with users 4. Done! ✅