Article Takeaways
  • A wildcard CORS rule on *.keshavsingh.in creates subdomain-takeover blast radius if DNS outlives an old service.
  • Scoped apps validate symmetric HS256 JWTs issued by id.keshavsingh.in without maintaining separate password databases.
  • WebAuthn RelyingPartyId is pinned to keshavsingh.in while login ceremonies remain restricted to explicit origin allowlists.

Why Multiple Independent Logins Break Multi-App Ecosystems

When a digital ecosystem grows from one site into eight specialized applications, duplicating user tables across every database quickly turns into a maintenance trap. Password resets drift out of sync, audit logs fragment across separate services, and users hesitate to register again on a sibling tool they only plan to test for two minutes.

Rather than embedding local login screens inside Pratiyogita, Hindu Panchang, Ghar Ledger, or AnimStudio AI, we separated authentication cleanly. A single .NET 10 identity service running on id.keshavsingh.in owns password verification, two-factor challenges, FIDO2 passkeys, and short-lived access tokens. Every sibling website acts strictly as a stateless resource server validating tokens issued under a shared issuer and audience contract.

Preventing Subdomain Takeover With Explicit Origin Validation

Sharing an HTTP-only refresh cookie across .keshavsingh.in requires disciplined cross-origin controls. Because credentialed CORS responses tell the browser to carry the shared session cookie, admitting an unconstrained wildcard rule across every subdomain would let any forgotten CNAME or retired test deployment inherit session authority.

Our DynamicEcosystemCorsPolicyProvider combines startup config origins with active records in MongoDB website registry metadata, enforcing HTTPS scheme checks and exact origin comparisons in production.

Boundary Responsibilities Across Central Identity and Resource APIs
LayerHostPrimary ResponsibilitySession State
Central Identity APIid.keshavsingh.inPasswords, OTP, FIDO2 Passkeys, Token RotationMongo refresh_tokens
Admin Workspaceadmin.keshavsingh.inRBAC grants, Website Registry, Global i18n SeedsBearer JWT + Cookie
AnimStudio AIstudio.keshavsingh.inStoryboards, FFmpeg renders, Channel schedulingJWT Validation Only
Ghar Ledgerghar.keshavsingh.inHousehold vendor entries mapped to SSO sub IDJWT Validation Only

Handling Multi-Tab Refresh Races Safely

In modern browser apps, a visitor often keeps two ecosystem tabs open side by side. If both tabs notice an expired access token at the exact same millisecond and fire simultaneous refresh calls, naive token rotation flags the second request as replay theft and revokes the user session.

Inside sibling frontends like AnimStudio AI, refresh POST calls opt out of blind HTTP retry loops and serialize concurrent browser-tab refresh attempts using the Web Locks API where supported, while preserving clean cookie domain upgrades on matching production hosts.

  • Never auto-retry state-changing refresh POST calls in transient HTTP failure interceptors.
  • Bind FIDO2 RelyingPartyId to keshavsingh.in once, but allowlist exact ceremony Origins only.
  • Serve non-secret cross-site configuration through public GET /api/config so UI shells never drift.

About the Author

Keshav Singh builds distributed .NET / Angular platforms and interactive digital creator tools across the keshavsingh.in ecosystem. Explore his full engineering resume on portfolio.keshavsingh.in.