Skip to content

feat(slack): Require Google sign-in before first Slack use - #2220

Draft
sentry-junior[bot] wants to merge 3 commits into
mainfrom
feat/slack-sign-in-poc
Draft

sentry-junior[bot] wants to merge 3 commits into
mainfrom
feat/slack-sign-in-poc

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Proof of concept for #2219. This adds an experimental slack-sign-in feature. With it on, Junior replies to a Slack user's mentions or DMs only when that Slack identity's user has a linked, verified Google identity. The dashboard is not required, and there is no new table or column: the Google identity is a normal junior_identities row that other features can reuse.

How it works:

  • At Slack ingress, if the Slack identity's user has no verified google identity, Junior drops the message. Ingress saves the Slack identity with its Slack profile email, stores one sign-in state for that identity (PKCE, 10 minute TTL), and privately sends the user a Google consent link.
  • Google redirects to /api/sign-in/callback, a core route like the plugin OAuth callbacks. It exchanges the code and reads the verified email and sub from the ID token. Then it checks the email against the dashboard allowlist (dashboard.allowedGoogleDomains/allowedEmails, else JUNIOR_DASHBOARD_GOOGLE_DOMAINS/JUNIOR_DASHBOARD_ALLOWED_EMAILS).
  • The callback links the Google identity (provider: "google", subject sub) only when the Slack identity in the state already belongs to the user with that Google email. A forwarded link cannot give another person's Slack account access.
  • It uses the dashboard's GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET. The Google OAuth client needs <base-url>/api/sign-in/callback as an authorized redirect URI. createApp throws if the feature is on with an empty allowlist.

Open questions for a real version:

  • The dashboard could sign in through this route and the same Google identity.
  • The check trusts any verified google identity on the user. A plugin that links user OAuth accounts under the google provider name would also satisfy it, so the sign-in provider name may need to be reserved.
  • Google sign-in lives in core. That is a provider name in core, so it may belong behind a small sign-in contract.
  • Passive thread replies (passive-routing), slash commands, and Slack actions are not checked.
  • A linked Google identity never expires, and the allowlist is checked only at sign-in. The dropped message is not replayed after sign-in.

via David Cramer.

--

View Junior Session [Sentry]

Add the experimental slack-sign-in feature. When it is on, Slack mentions
and DMs from a user who has not signed in are dropped, and the user gets a
private link to the dashboard sign-in page. The page marks Slack identities
already linked to the Google user through a verified email as signed in.

Refs #2219

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 24, 2026 2:01am UTC

Request Review

Slack sign-in now runs its own Google OAuth flow at /api/sign-in/callback,
like plugin OAuth callbacks, so it does not need the dashboard. The state
binds one Slack identity. The callback checks the dashboard allowlist and
the Slack email before it marks that identity as signed in.

Refs #2219

Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title feat(slack): Require dashboard sign-in before first Slack use feat(slack): Require Google sign-in before first Slack use Oct 24, 2026
Drop the signed_in_at column and migration. Sign-in now links a verified
Google identity to the user of the Slack identity that started it. Slack
ingress checks that the Slack identity's user has that Google identity, so
other features can reuse it.

Refs #2219

Co-Authored-By: David Cramer <david@sentry.io>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 8ce93737 Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants