feat: Add optional issuer config for access token validation - #54
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
Original prompt from madison.packer
|
Greptile SummaryAdds optional JWT issuer validation throughout the shared AuthKit core configuration path.
Confidence Score: 5/5The PR appears safe to merge; the changes fully address both previously reported issuer-configuration defects without introducing a new actionable issue. Environment-only issuers are now included in full configuration assembly, while comma splitting is limited to environment-derived values so programmatic issuer strings remain exact. Both previous threads were manually resolved after these fixes, and no blocking failure remains. Important Files Changed
|
… only from env Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Summary
Adds an opt-in
issclaim check toAuthKitCore.verifyToken. Whenissueris configured (configure({ issuer })orWORKOS_ISSUER, resolved by the existingConfigurationProviderenv-var mapping), it is passed tojose.jwtVerify; when unset, behavior is unchanged (noisscheck). This flows through to every framework built on authkit-session (tanstack-start, sveltekit, astro).issuerisstring | string[]so an app can accept tokens from more than one issuer (e.g. during an issuer migration);jose'sissueroption already accepts both. AWORKOS_ISSUERvalue from the value source is split on commas inConfigurationProvider.convertValueType(trimmed, empties dropped; a single value stays a string); programmaticconfigure({ issuer })strings are passed through verbatim.ConfigurationProvider.getConfig()previously only enumerated keys with defaults plusrequiredKeys, so an optional key set only in the value source never reached the config handed toAuthKitCorebycreateAuthService(). It now also enumeratesoptionalKeys(apiPort,issuer,cookieSameSite,cookieDomain) — this is what makes an env-onlyWORKOS_ISSUERtake effect, and as a side effect fixes the same gap for env-onlyWORKOS_API_PORT/WORKOS_COOKIE_SAME_SITE/WORKOS_COOKIE_DOMAIN.Opt-in rather than defaulted because the API does not mint a single issuer shape — it varies by environment (
https://api.workos.comfor legacy environments,https://api.workos.com/user_management/<clientId>for environments created since mid-2025, custom auth domains, and flag-gated path variants). Mirrors workos/authkit-nextjs#476 and workos/authkit-remix#90.Link to Devin session: https://app.devin.ai/sessions/0ee38e859a9849658a7cdb2d215d89a6
Open in Devin Desktop: https://app.devin.ai/desktop/session/0ee38e859a9849658a7cdb2d215d89a6?variant=devin
Requested by: @m0tzy