Skip to main content

Magic Links - Passwordless Email Login

About 2 min read

A magic link is a one-time login URL sent to the user's email address. Instead of entering a password, authentication is completed simply by clicking the link in the email. However, its security depends on the safety of the email account, which sets it apart from more robust passwordless technologies such as passkeys.

How Magic Links Work

The authentication flow of a magic link is technically similar to a one-time password (OTP). The difference is that, instead of a numeric code, an email is sent containing a URL with a cryptographically secure random token.

Magic Link Authentication Flow
① Enter email address
② Server generates a token
③ Email a URL with the token
④ User clicks the link
⑤ Verify token → issue session

The following constraints are placed on the token.

  • Expiration: limited to a short time. Expired links become invalid
  • Single use: the token is invalidated immediately after being clicked. It cannot be reused
  • Cryptographic randomness: use a token of sufficient length that cannot be guessed
  • IP binding (optional): some services compare the IP address of the request with that of the click

Adoption Example

Slack

Slack's help center lists entering a confirmation code sent by email, a passkey, or single sign-on where required as ways to verify identity when signing in with an email address.

Advantages and Disadvantages

AdvantagesDisadvantages
No need to remember or manage passwordsDepends entirely on the security of the email account
No risk of password leakage or reuseWait time until the email arrives (seconds to minutes)
Simple to implement (no server-side password storage)No phishing resistance (users can be tricked by fake emails)
Low barrier to user registrationCannot log in in an offline environment

Magic links have no phishing resistance. The article on email account protection covers ways to strengthen email security.

Comparison with Passkeys

Both magic links and passkeys are passwordless authentication, but their security models are different.

AspectMagic linkPasskey
Basis of authenticationPossession of the email accountPossession of the device + biometrics
Phishing resistanceNoneYes (origin-bound)
Login speedSlow (waiting for email)Instant (fingerprint or face recognition)
Ease of adoptionVery easySomewhat complex (WebAuthn implementation)

The article on the challenges of migrating to passkeys explains a phased migration strategy from magic links to passkeys.

Common Misconceptions

The belief that "magic links are safer than passwords" is half right and half wrong. While they eliminate the risks of password reuse and weak passwords, if the email account is compromised, the magic links sent to it also fall into the attacker's hands. If multi-factor authentication (MFA) is not configured on the email account, the security of a magic link depends on the strength of the email account password. The article on two-factor authentication covers ways to protect the email account.

Login Frequency as an Axis for Choosing Between Methods

One axis when deciding whether to adopt magic links is how often users log in to the service in question. Logging in with a magic link always involves waiting for the email to arrive, opening the inbox, and clicking the link. This wait may be a minor inconvenience once, but for a tool used every day it accumulates as friction and easily turns into complaints that logging in is slow. For services used only occasionally, the situation reverses: the longer the interval between uses, the more easily a password is forgotten, and a reset procedure is sometimes needed on a visit, whereas with a magic link there is nothing to remember in the first place, and access resumes as long as the email address is available. For this reason, one option is to divide roles by frequency: passkeys, which involve no waiting, for tools that are logged into frequently, and magic links for low-frequency uses. In either case, the foundation of security still rests on protecting the email account.

Frequently Asked Questions

What is a magic link?
It is a mechanism that authenticates you by clicking a one-time login URL sent by email instead of entering a password. The token in the link carries an expiration and a single-use restriction.
What are the disadvantages of magic links?
There are four main disadvantages: (1) security depends on the safety of your email account, (2) there is no phishing resistance against attacks using fake login pages, (3) logging in is slow because you must wait for the email to arrive, and (4) you cannot log in offline. If multi-factor authentication is not set on the email account, the effective security depends on the strength of the email account password.
Are magic links safer than passwords?
They are safer in that they eliminate the risks of password reuse and weak passwords. However, if your email account is compromised, the magic links sent to it also fall into the attacker's hands. Setting up multi-factor authentication on the email account is a prerequisite, and passkeys, which are phishing-resistant, offer more robust passwordless authentication.

Was this article helpful?

Related Terms