Skip to content

Allow optional uid in Google seed config to stabilize sub claim across restarts#167

Open
ikad wants to merge 1 commit into
vercel-labs:mainfrom
forgxisto:fix/google-seed-uid
Open

Allow optional uid in Google seed config to stabilize sub claim across restarts#167
ikad wants to merge 1 commit into
vercel-labs:mainfrom
forgxisto:fix/google-seed-uid

Conversation

@ikad

@ikad ikad commented May 28, 2026

Copy link
Copy Markdown

Summary

  • Add optional uid field to GoogleSeedUser interface
  • Use the provided uid when seeding users, falling back to generateUid("goog") if omitted

Problem

When running the Google emulator in Docker or any environment where the process restarts, the sub claim in id_tokens changes on every restart because uid is always generated randomly. Applications that store users by their sub value treat the same person as a different user after each restart.

Solution

Follow the same pattern already established by the Okta emulator (okta_id?: string with user.okta_id ?? generateOktaId("00u")), allowing operators to pin a stable uid in their seed configuration:

seedFromConfig(store, base, {
  users: [
    { email: "alice@example.com", uid: "goog_stable_uid_alice" }
  ]
})

When uid is omitted the behavior is unchanged — a random ID is generated as before.

@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

@ikad is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant