Account security

New device sign-in alerts: which events to notify and what to write

5 min read

Key points

  • Always notify users through a separate channel when an authenticator such as a passkey is added and when the account is recovered.
  • Synced passkeys use the same credential on several devices, so recognize a new device by device data your service records, not by credential ID.
  • Say what happened, when and on which device, and what to do right away if it wasn't them.

The fastest way for users to notice account takeover is to tell them about important account events through a separate channel they read, such as email. At minimum, notify them when an authenticator such as a passkey is added and when the account is recovered; NIST SP 800-63B-4 makes both mandatory. Alerts for sign-ins from unfamiliar devices need device data that your service records, because a passkey's credential ID alone cannot tell you which device was used.

Which events to notify

NIST SP 800-63B-4 is written for US government digital identity, but it is specific about which events users should hear about:

Event NIST SP 800-63B-4
A new authenticator (such as a passkey) is bound SHALL notify, via a mechanism independent of the binding transaction
Account recovery SHALL notify
A replacement recovery code is issued SHALL trigger an account recovery notification
An authenticator is invalidated (removed or revoked) SHOULD notify

On top of that, the OWASP Session Management Cheat Sheet recommends that web applications let users check details of active sessions, monitor and alert users about concurrent logons, and let them terminate sessions remotely. Put together, the candidate events are:

  • Passkey added or removed
  • Account recovery (re-registration after an identity check)
  • Password or email address changed
  • Sign-in from an unfamiliar device or browser

The passkey-added alert matters most. If an attacker gets in and registers a passkey on their own device, they can keep signing in with it even after the password is changed. An alert lets the real user catch it right away.

Recognizing a new device

A credential ID is not a device ID

A passkey sign-in response tells you which credential was used. But as W3C WebAuthn explains, a synced passkey (multi-device credential) is used across the user's devices. Sign in from a new phone with a synced passkey and the credential ID is the same as on the old one.

So "first use of this credential" is one hint, not proof of a new device. And when a synced passkey is used on a new device, the credential ID alone will miss it.

Remember devices on your side

To recognize new devices, record something like the following on your side and compare it at each sign-in:

  • A per-device identifier: after a successful sign-in, set a long-lived cookie with an unguessable random value and store it with the account. No cookie, or an unknown value, at the next sign-in means a new browser.
  • User-Agent: use the OS and browser in the alert text. It can be spoofed, so it is weak as evidence, but it helps users recognize their own device.
  • IP address and approximate region: helpful in the alert text. Location is personal data, though. NIST SP 800-63B-4 notes that device and location characteristics used for session monitoring have privacy implications and must be covered in the privacy risk assessment. Decide what you keep and for how long before you use it.

Users who clear cookies or browse privately will get alerts more often, so say "If this was you, no action is needed" to avoid alarming them.

What to put in the message

NIST SP 800-63B-4 requires notifications to include clear instructions, with contact information, in case the recipient repudiates the event. Include:

  1. What happened: "A new passkey was added" or "New sign-in from a new device"
  2. When: date and time, with the time zone
  3. On which device: OS, browser, approximate region
  4. What to do if it wasn't you: sign in and remove the passkey, sign out of all devices, contact support, with the contact details

An example:

[Example Service] A new passkey was added to your account

A new passkey was added to your account on February 6, 2027 at 10:42 AM (PST). Device: iPhone (Safari)

If this was you, no action is needed. If you don't recognize this, sign in to Example Service now and remove the passkey under Account settings > Passkeys. If you can't sign in, contact support@example.com.

Make the alert itself hard to imitate. If the email contains a link that signs the user straight in, a lookalike phishing email becomes indistinguishable. Tell users to sign in from their bookmark or app instead.

Recipients and frequency

  • Recipients: NIST SP 800-63B-4 requires support for at least two notification addresses per account (email, phone number, and so on). Right after an attacker changes the email address, sending only to the new address will not reach the real user. Send email-change alerts to the old address too.
  • Frequency: alerting on every sign-in trains users to ignore alerts. Limit them to new devices and changes to authentication settings.

Implementing this with SealGate

With SealGate, passkey registration and sign-in travel from the browser SDK through your server to the SealGate API. That relay is the most reliable place to trigger alerts, because your server knows who is signed in and has the request's User-Agent, IP address and device cookie.

js
// Your relay server (the docs example with alerts added)
const res = await fetch(`${BASE}/${body.kind}/${step}`, { /* relay with your API key */ });
const json = await res.json();

if (step === 'verify' && res.ok && body.kind === 'register') {
  await notifyPasskeyAdded(user, req.headers.get('user-agent'));   // passkey-added alert
}
if (step === 'verify' && res.ok && body.kind === 'login') {
  const device = await knownDevice(json.external_id, req);           // check the device cookie
  if (!device) await notifyNewDevice(json.external_id, req);         // new device alert
  await createSession(json.external_id);
}

Events that do not pass through your relay, such as revoking a passkey in the dashboard or issuing a recovery token, can come in as webhooks. Set a URL in the environment settings in the dashboard, and SealGate sends signed events including register.completed, login.succeeded, credential.revoked, user.revoked and recovery.issued. The body is { type, timestamp, data }. The webhook-id header stays the same across retries, so use it to avoid sending the same alert twice. Verify signatures with the webhookadmin package on npm.

The documented data for login.succeeded is app_id, end_user_id, external_id and credential_id, with no device information (User-Agent or IP address). Check the actual delivery log for each event's data fields before you build on them. See Webhooks in the docs.

FAQ

Do passkey sign-ins still need new device alerts?

Passkeys are hard to phish, but an attacker can still get in another way and add a passkey. Alerts for new authenticators are needed even with passkeys.

Can I send alerts by SMS?

NIST SP 800-63B-4 lists phone numbers for text messages as a notification address. But if the phone number has been hijacked, the alert will not reach the user, so pair it with another address such as email.

Sources

Related posts

Back to the blog