Changing Your Domain? Check What WebAuthn Passkeys Bind to First

Plan a WebAuthn passkeys domain migration: compare URLs and RP IDs, preserve sign-in, prepare account recovery, and test supported devices.

Published
Reading time
9 min read
Changing Your Domain? Check What WebAuthn Passkeys Bind to First
On this page

A website move can preserve existing passkeys, but only if the new sign-in flow remains compatible with the relying party ID used when those credentials were created. Before a WebAuthn passkeys domain migration, inventory both the URLs users visit and the RP IDs your authentication service actually uses.

This guide explains the decision points, a migration path, and the tests to run before changing production traffic. Research limitation: The current W3C specification and browser documentation were not available to consult for this article. Confirm browser-specific behavior and current guidance before implementing your plan.

Key Takeaways

  • A URL and a WebAuthn relying party ID (RP ID) are different things. A URL can change while the RP ID stays the same.
  • An HTTP redirect does not transfer a passkey to a new RP ID. A credential created for one RP ID cannot simply be reused as a credential for another.
  • A shared parent-domain RP ID can support eligible subdomains, but the server must still validate the actual origin and other WebAuthn response data.
  • If the RP ID must change, plan for users to authenticate through an accepted existing method and register a new passkey. Keep a recovery path for users who cannot do either.
  • Browser and platform behavior can differ. Test representative devices and authentication flows before production rollout.

What a passkey binds to

The RP ID identifies the relying party—the service for which the credential is created. It is a domain string, not a full URL: it does not include a scheme, port, path, or query string. WebAuthn associates the credential with that RP ID, and the authenticator response includes data that the server checks against the expected RP ID.

The origin identifies the web context making the request. It includes the scheme, host, and port. Your server must verify that the origin in the WebAuthn response is one it explicitly accepts; accepting an RP ID is not a substitute for checking the origin.

For a conventional WebAuthn request, the RP ID must have an appropriate relationship to the caller's domain: it can be the caller's effective domain or an eligible parent domain. A public suffix is not an eligible shared RP ID. WebAuthn also requires an appropriate secure context. Do not treat a URL parser or a string suffix check as an implementation of browser RP ID validation.

Consider these illustrative configurations:

Existing sign-in originExisting RP IDProposed originPlanning implication
https://login.example.comexample.comhttps://accounts.example.comThe parent RP ID may remain usable. Add the new exact origin to the server's accepted origins and test the complete flow.
https://login.example.comlogin.example.comhttps://accounts.example.comThe sibling origin cannot ordinarily use the old subdomain RP ID. Plan for a new RP ID and credential enrollment, or retain an appropriate old-domain sign-in flow.
https://login.example.comexample.comhttps://login.example.netThis is a change to an unrelated domain. A redirect alone does not make the old credential a credential for example.net.

These examples assume ordinary top-level web flows. Related-origin capabilities and embedded flows can introduce additional rules and compatibility considerations; verify current specifications and browser documentation rather than assuming those capabilities are available everywhere.

Advertisement

Decide whether the RP ID can stay the same

Start with the RP ID used for existing registrations, not the domain you intend to configure after the move. Check your server configuration and registration records, including tenant-specific or legacy configurations. A credential registered under a subdomain RP ID does not become a parent-domain credential just because you change a configuration value.

If the existing RP ID remains valid

A move between eligible subdomains may leave the RP ID unchanged. In that case, preserve the existing credential records and configure the authentication server to accept the new, exact origin. Continue to validate the challenge, response type, RP ID, signature, and any required user verification under your established WebAuthn policy.

Test registration and sign-in from the new origin before routing users there. A change in scheme or port also changes the origin, even when the hostname and RP ID are unchanged. Update origin validation deliberately; do not replace an exact allowlist with a broad wildcard merely to make the migration work.

Using a parent-domain RP ID is a scope decision, not a universal recommendation. It can make eligible subdomain moves easier, but it also makes it important to govern those subdomains and maintain strict server-side origin checks. An eligible browser context does not mean your server should trust every origin under the parent domain.

If the RP ID must change

Treat the new RP ID as a new credential scope. A practical staged approach is:

  1. Keep the old sign-in service available over HTTPS on a domain you control, where the existing RP ID remains usable.
  2. Let the user authenticate there with their existing passkey or another accepted sign-in method.
  3. Transfer the authenticated session to the new service through an established, secure authentication handoff. For separate domains, do not assume a browser cookie is shared; use a short-lived, single-use handoff with appropriate binding and validation.
  4. On the new origin, ask the authenticated user to register a passkey for the new RP ID. Associate the new credential with the correct existing account.
  5. Confirm that the new passkey works before encouraging the user to rely on it. Maintain fallback sign-in and recovery through the transition.

A redirect can send the browser to the old sign-in page or start an authentication handoff. It does not change the RP ID of an existing passkey. Do not put passkeys, reusable authentication assertions, session tokens, or other secrets in URL parameters.

If the old domain will no longer be controlled, schedule and complete the migration before relinquishing it. Losing control of the old domain can remove the ability to run the old web sign-in flow and introduces separate domain-takeover risks. Users who have not registered a new credential will need a separately designed recovery path.

Migration-planning checklist

  • Inventory supported domains and RP IDs. Record every production sign-in origin, RP ID, environment, tenant, and credential population. Identify redirects, embedded sign-in, native or hybrid app flows, and any old domains that must remain operational.
  • Map origin and RP ID pairs. For each destination, decide whether the existing RP ID is valid under the applicable browser rules. Define the exact origins the server will accept for each flow.
  • Plan credential enrollment. If the RP ID changes, provide an authenticated new-passkey registration flow and an account-level indication of whether enrollment is complete. Do not delete the old credential merely because the user has visited the new site.
  • Communicate before and during the move. Explain the new sign-in address, whether users need to create another passkey, when the old sign-in route will stop working, and how to get help. Give users a way to verify migration notices through a known channel.
  • Preserve fallback sign-in. Identify which existing methods remain available, their security requirements, and how long they will be supported. Avoid silently weakening authentication just to increase migration completion.
  • Prepare account recovery. Define how users who lost their authenticator or missed the migration can regain access. Protect recovery against impersonation and test support procedures as well as the technical flow.
  • Roll out and monitor. Start with a limited cohort, monitor registration and sign-in failures by flow and platform, and retain a rollback plan. Avoid logging credentials, challenges, or other sensitive authentication data unnecessarily.
  • Set retirement criteria. Measure outstanding users and recovery readiness before disabling the old flow. Keep domain ownership and operational responsibilities explicit throughout the transition.

Advertisement

Test browsers, devices, and failure paths

Passkey presentation, synchronization, authenticator availability, and support for newer WebAuthn capabilities vary across browsers, operating systems, password managers, and authenticator types. A successful test on one laptop does not establish compatibility across your user base.

Build a matrix from the devices and browsers your service supports. Include platform and roaming authenticators where relevant, and test both existing and newly registered credentials. At minimum, verify:

  1. Existing passkey sign-in on the old origin, including a user with more than one credential.
  2. Sign-in on the new origin with the same RP ID, if that is your intended design.
  3. New credential registration and subsequent sign-in under the new RP ID, if it changes.
  4. Fallback and recovery for a user without access to the old authenticator.
  5. Server rejection of an unexpected origin, an incorrect RP ID, an invalid or reused challenge, and a response associated with the wrong account.
  6. The complete redirect or session-handoff path, including expired or reused handoff attempts.
  7. User cancellation, unsupported capabilities, and an unavailable authenticator, with actionable error messages.

Perform these checks in a controlled environment before production and repeat them on representative real devices. Consult current vendor documentation for the exact browser and platform versions you support; this article does not establish a compatibility matrix.

Common Mistakes

  • Assuming the visible hostname is the RP ID. The configured RP ID may be a parent domain or a more specific host. Inspect the existing configuration.
  • Changing the RP ID and expecting credentials to follow. Existing credentials remain associated with their original RP ID; plan re-enrollment or an old-domain sign-in route.
  • Treating redirects as credential migration. Redirects move browser navigation, not credential scope.
  • Validating only the RP ID. Server-side verification must also validate the expected origin and the other WebAuthn response properties required by the flow.
  • Retiring the old domain too early. A user who never enrolled a new credential may be locked out unless another sign-in or recovery method works.
  • Assuming synchronization solves cross-domain migration. A passkey available on another device is still associated with its original RP ID.

Best Practices

Keep an explicit inventory of RP IDs and accepted origins, and treat changes to either as authentication changes requiring review. Use established WebAuthn server tooling rather than implementing verification from scratch. Keep the old and new flows distinguishable in configuration and monitoring, and validate the expected RP ID and origin for the particular flow rather than trusting values supplied by the client.

Before choosing a migration strategy, consult the current W3C Web Authentication specification and documentation for each supported browser and platform. In particular, verify any related-origin or embedded-flow behavior you intend to rely on, then test it on representative devices.

Conclusion

A domain migration does not necessarily require a new passkey, but an RP ID change requires a deliberate credential and recovery plan. Establish the existing RP ID first, validate the destination origin, and test the full sign-in journey before moving production users.

What would your domain sell for?

A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.