Repository navigation
Open
Description
Provider accounts are only linked to a Junior user in a narrow case: a plugin that implements resolveOAuthAccount finishes an OAuth callback that a Slack actor started. Because of this, Sentry accounts never link, and many GitHub accounts don't either. Person-level lookups such as userLookup and PR assignment then can't connect a Slack user to their GitHub or Sentry account.
Current behavior
handlers/oauth-callback.tswrites the provider identity withupsertLinkedIdentityonly whenstored.actor?.platform === "slack"and the plugin returns an account.- Only
junior-githubimplementsresolveOAuthAccount.junior-sentryhandles OAuth but never resolves the account, sogetOAuthAccountProviders()leaves Sentry out anduserLookuponly offersslackandgithub. - OAuth connections started from the dashboard or web UI (web actor) skip linking. The web identity (
provider: "junior", verified email) already resolves to the samejunior_usersrow. - Linking was added in feat(tools): Add provider-scoped userLookup #1359 (2026-08-10). GitHub tokens connected before then were never backfilled, and since the stored token keeps working the user is never prompted to connect again.
pluginProviderAccountSchemahas no email field, so a provider account can't contribute a verified email for the existing email-based user linking (chat/identities/README.md), even when it matches the user's Slack email.junior-githubresolves the account withGET /useronly. That returns the profile email only when it is public. It does not callGET /user/emails, which lists every email on the account withverifiedandprimaryflags.- Junior authorizes GitHub users through GitHub App user access tokens. For these tokens,
GET /user/emailsneeds the App's "Email addresses" user permission (read), not an OAuth scope (GitHub docs). - No
oauth.callback.identity_link.failederrors appeared in Junior telemetry over the last 90 days. The link step is skipped, not crashing.
Gap
- A user with a verified Slack email, an active GitHub connection, and a Sentry connection can still have no linked GitHub or Sentry identity.
- Whether accounts get linked depends on which surface started the connection and when it was made, not on the person.
Proposals (from requester)
- Link provider accounts when the user interacts through the web UI, not only from Slack.
- Read all verified GitHub account emails (a GitHub account can have several) and match them against the user's verified Slack email. Match only verified addresses.
- Use the user's verified Slack email as the connection point for provider accounts (for example, a verified Sentry account email that matches).
Reported by Burak Yigit Kaya.
via BYK.
--
Metadata
Metadata
Assignees
Labels
No labels
Activity
feat(identities): Link OAuth accounts from web connections and verifi…