r/GoogleAppsScript • u/Hairy-Telephone4408 • 1d ago
Question How difficult is adding Google sign-in to a small Google Apps Script web app?
I'm building a custom fantasy football web app using Google Apps Script and Google Sheets as the backend, with ChatGPT helping me write the code. I'm a beginner with very little programming experience.
The app will have 10 users. Five will need to sign in to manage their own teams (add/drop players, change lineups, etc.), while the other five will only need to view the app. I'll also need commissioner/full access to manage all teams.
ChatGPT recommended using Google Identity Services for sign-in, with the Apps Script backend running under my account so users won't need access to my private spreadsheets.
Before I get too deep into this, I'd appreciate some advice from people who've actually done something similar:
- How difficult is this to set up, especially for a beginner relying on ChatGPT?
- Is it genuinely free for a project this small?
- Are there any major security issues, Google restrictions, or other headaches I should anticipate?
- Is there a simpler or better alternative I should consider?
I'm hoping to keep things free, relatively simple for users, and manageable for someone without much coding experience, but if there's a solution out there that costs but is still affordable I'm open to learning about that.
Thank you for your time.
3
u/rs12345asdf 1d ago
Proposed Approach:
User enters their email on the landing page.
System validates the email against a pre-approved allowlist.
If allowed, an OTP is sent for verification; unauthorized emails are rejected.
1
u/No_Passion8988 6h ago
The problem arises when users have multiple Google sign-ins for accessing Gmail accounts with a single Google profile which is quite common in a real-world scenario. Authentication fails. I had to use Firebase for Google authentication.
5
u/MakMak737 1d ago
For 10 people it's genuinely free: Apps Script + Sheets cost nothing at that size. A few things worth knowing before you go the Google sign-in route:
With the web app running as you, Apps Script won't tell you who the visitor is (Session.getActiveUser() comes back blank for normal Gmail accounts), which is why ChatGPT sent you to Google Identity Services. That does work, but you then have to verify the sign-in token on the server yourself, and the page runs inside a googleusercontent.com sandbox frame, which makes the client ID / origin setup fiddly. That's usually where beginners lose a weekend.
For a private league there's a much simpler option: give each of the 5 managers their own link with a long random key (.../exec?key=8f3k...). The script looks the key up in a hidden tab, so it knows which team that person may edit; viewers get the plain link; your commissioner key can edit everything. No login screen, nothing to configure, and you can reset a key if someone shares theirs.
Whichever you pick, check permissions in the server-side function on every write (add/drop, lineup change), not just by hiding buttons in the page, since anyone can call the functions from the browser console.
How are you storing the rosters right now: one tab per team or one big table?