Before the Customer Clicks: Rehearsing Magic-Link Logins Against Inbox Prefetchers
Photo: CEphoto, Uwe Aranas, CC BY-SA 3.0, via Wikimedia Commons
Magic links look elegantly simple: request a sign-in link, receive it by email, click once, and arrive authenticated. The simplicity is also the weakness. In a UK inbox shaped by Microsoft 365, Google Workspace, Mimecast, Proofpoint and consumer ISP filtering, the first entity to open a link is often not the customer. It may be a URL detonation sandbox, a link-prefetching mobile client, or a mail gateway applying a reputation check. If that first open consumes the one-time token, the customer meets a dead end and the trust cost lands on your support desk.
The failure mode is not the link; it is the assumption
The common design assumes a one-to-one relationship between token issuance and human click. Real inboxes break that assumption. A link can be fetched by a scanner, cached by a preview service, rewritten by a secure email gateway, or opened by a mobile mail app before the recipient has even looked at the message. From the identity system's perspective, the token has been used. From the customer's perspective, they have been locked out by their own email provider.
This is a reliability problem with a security edge. Relaxing the token to permit multiple redemptions weakens the control. Tightening it without a fallback turns a routine login into a support incident. The engineering answer is to make the token state machine more honest: distinguish delivery, observation and redemption, then design the journey around that distinction.
Where UK inboxes intervene
The pattern varies by provider and by the customer's employer. Microsoft Defender for Office 365 Safe Links can detonate URLs and wrap them for later inspection; the customer's click is mediated by Microsoft infrastructure. Mimecast and Proofpoint commonly rewrite links for reputation checks. Google Workspace is generally less aggressive at consuming links, but Gmail's image proxy and link-scanning behaviours still produce automated fetches. Consumer services such as BT Internet, Sky, Virgin Media and TalkTalk apply their own spam and phishing filters, often with prefetch behaviour that is invisible to the customer.
Mobile clients add another layer. Outlook on iOS and Android, Apple Mail and some third-party clients may generate link previews. The result is a spectrum: some providers will open a link once, some will open it repeatedly, and some will only rewrite it. A test plan must treat these as distinct behaviours rather than a single 'email scanner' category.
Instrument the token lifecycle
Start by separating the landing page from the redemption action. A GET request to the magic-link URL should render a neutral, accessible confirmation page: 'Continue to sign in'. The token is consumed only when the customer submits that page, preferably by POST with a short-lived session cookie set on the initial GET. This changes the scanner's interaction from a redemption to a harmless observation.
Next, bind the token to the initiating browser context. When the customer requests the link, set an encrypted, HttpOnly cookie on the requesting device. On redemption, require that cookie alongside the token. A scanner in a different network and user-agent context will not possess it. This is not a silver bullet, because customers often request a link on one device and open it on another, so the fallback must handle that legitimate case.
Telemetry should capture enough signal to classify the event without over-collecting personal data. Record user-agent, autonomous system number, coarse geography, JavaScript execution, time between issue and open, and whether the landing page was submitted. Hash or truncate IP addresses where full retention is unnecessary, and align retention with UK GDPR expectations. The aim is a classification, not a dossier.
A practical rehearsal plan
- Build a synthetic test matrix across the providers your customers actually use. Include at least one Microsoft 365 tenant with Safe Links, one Google Workspace domain, one Mimecast or Proofpoint customer, and two consumer ISP mailboxes common in the UK.
- Send controlled magic links to each mailbox and observe the full lifecycle: delivery, automated fetch, customer click and redemption. Run the test at off-peak and during a busy period; scanner behaviour can change with load and policy.
- Instrument the landing page to log scanner-like events separately from human submissions. A GET with no JavaScript, an unusual ASN, or a fetch within seconds of delivery is a candidate scanner event. Do not block on these signals alone; use them to measure.
- Rehearse the fallback. When a customer arrives at an already-used link, the page should not say only 'invalid'. It should explain that the link may have been opened by their email provider, offer a one-time code entry route, and provide a clear request-new-link action.
- Test the support path. Brief agents on the new language, give them a safe reissue tool, and log every reissue reason. Support scripts should never ask the customer to forward the link.
Fallbacks that do not weaken the control
A code-entry fallback is usually the least disruptive. The customer requests a magic link; the email contains both a link and a short numeric code; the landing page accepts either. The code is bound to the same token record, expires quickly, and is rate-limited. This gives scanner-heavy inboxes a path that does not depend on link redemption at all.
For higher-risk journeys, add a second factor or a device-bound session. For lower-risk journeys, allow a reissue with a short cool-down. The principle is consistent: never make a one-time link infinitely reusable, but never make a scanner's behaviour indistinguishable from customer failure.
What to measure afterwards
Track redemption success by provider, scanner-open rate, reissue rate, code-entry adoption, support contacts per 1,000 sign-in attempts, and time from request to authenticated session. These are trust signals as much as performance metrics. A rise in reissues may indicate a scanner change; a rise in support contacts may indicate that the fallback language is unclear.
The magic link remains a good pattern. It asks the customer to prove control of an inbox, which is a meaningful trust check. The rehearsal is about acknowledging that the inbox is an active participant, not a passive delivery pipe. Once the token lifecycle reflects that reality, the customer experiences a login that works, and the security team keeps a control that still means something.