Auth: Google SSO (OAuth2 / OIDC)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- go
- Domain
- authentication, backend, database, security
Research direction
Start by reviewing #16 for the users table foundation and #2 for the parent authentication design. Use the stated environment variables and OAuth2/OIDC flow as the implementation map, including the callback, state-cookie verification, Google token validation, user upsert, and session creation. Done means users can sign in with Google securely and return to / with a session.
Written by the indexing model from the issue text.
Description
Sub-issue of #2. Depends on #16 (users table must exist first).
Add "Sign in with Google" via OAuth2 / OpenID Connect.
Setup (one-time, outside the codebase)
- Go to Google Cloud Console → APIs & Services → Credentials.
- Create an OAuth 2.0 Client ID (Web application type).
- Add your redirect URI:
https://<your-domain>/auth/google/callback. - Copy the Client ID and Client Secret into your env file.
Environment variables
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URL=https://<your-domain>/auth/google/callback
Flow
Browser Server Google
│ │ │
│── GET /auth/google ───────────►│ │
│ │── redirect to accounts.google.com/o/oauth2/auth
│◄── 302 ────────────────────────│ with client_id, redirect_uri, scope=openid email profile
│ │ │
│── user logs in to Google ─────────────────────────────────► │
│◄── redirect to /auth/google/callback?code=... ───────────────│
│ │ │
│── GET /auth/google/callback ──►│ │
│ │── POST /token (exchange code)►│
│ │◄── id_token + access_token ──│
│ │── verify id_token signature │
│ │── upsert user by email │
│ │── create session │
│◄── 302 / (session cookie) ────│ │
Implementation
- Use
golang.org/x/oauth2+golang.org/x/oauth2/google— no heavy frameworks. - Verify the
id_tokenJWT signature against Google's public keys (JWKS endpoint). - On callback: look up
usersby email. If found, attach Google identity. If not, create a new user withpassword_hash = NULL. - State parameter (random nonce stored in a short-lived cookie) must be verified to prevent CSRF.
Related
- #2 Authentication (parent)
- #16 Username/password (users table foundation)
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from williamokano/SentinelSnap
-
enhancement infrastructure security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
williamokano/SentinelSnap#36 ·
-
enhancement infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
williamokano/SentinelSnap#35 ·
-
improvement low priority
Difficulty 5/5 Over a week Newbie friendliness 38/100
williamokano/SentinelSnap#75 ·
-
chore low priority
Difficulty 3/5 1-2 days Newbie friendliness 72/100
williamokano/SentinelSnap#74 ·
-
ci enhancement infrastructure security
Difficulty 4/5 3-5 days Newbie friendliness 48/100
williamokano/SentinelSnap#46 ·
All issues in williamokano/SentinelSnap
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100