OfficialSPIAuthenticationActive

keycloak-magic-link

p2-inc/keycloak-magic-link ↗

Passwordless magic-link login.マジックリンク(パスワードレス)認証

A COPYING file exists; license type not confirmed.

★
430
Forks
121
Contributors
39
Updated
2026-10-20
KC
26.8.0
License
Other (see repo)

What it can doできること7

  • Passwordless login with a magic link sent by email, using an action token so the link also works when opened on another device (e.g. desktop login, phone click).メールのマジックリンクでパスワードレスログイン。Action Tokenを使うため、別端末で開いても有効(PCでログインしてスマホでクリック、など)
  • Optionally create the user on first use and force UPDATE_PROFILE / UPDATE_PASSWORD.初回に自動でユーザーを作成し、UPDATE_PROFILE/UPDATE_PASSWORD を強制することもできる
  • "Magic link continuation": confirm via email while the original login page polls and completes the login there (10 minute default expiry).「Magic link continuation」では、メールで承認すると元のログイン画面がポーリングしてそこでログインが完了する(有効期限は既定10分)
  • Generate magic links through a REST API (manage-users role), with expiry, reusability, PKCE/state/nonce and response mode, and either email them or return them to the caller.REST API(manage-users ロール)でリンクを発行できる。有効期限、再利用可否、PKCE/state/nonce、レスポンスモードを指定でき、メール送信か呼び出し元への返却かを選べる
  • "Login Token": a variant that runs the normal browser flow, so acr_values, step-up and TOTP still apply.「Login Token」方式は通常のブラウザフローを通すため、acr_values・ステップアップ・TOTPも効く
  • Also includes an email OTP (6 digits) authenticator, account-activation authenticators and Cloudflare Turnstile CAPTCHA.メールOTP(6桁)、アカウント有効化用のAuthenticator、Cloudflare Turnstile CAPTCHAも同梱
  • Extend the behaviour through an SPI (MagicLinkCustomizationProvider) instead of forking.フォークせずにSPI(MagicLinkCustomizationProvider)で挙動を拡張できる

What it cannot do / limitsできないこと・制約6

  • Licensed under the Elastic License 2.0 — not an OSI open-source license; check the terms before commercial use.ライセンスはElastic License 2.0で、OSI準拠のOSSライセンスではない。商用利用前に条件を確認
  • Links from the REST API (action token) log the user in directly and skip the authentication flow, so step-up / acr_values are not evaluated (use Login Token for that).REST APIで発行したリンク(Action Token)はフローを通らず直接ログインするため、ステップアップや acr_values は評価されない(必要ならLogin Tokenを使う)
  • The continuation authenticator cannot be customised through the SPI — email sending and user validation are fixed.continuation方式はSPIでカスタマイズできない(メール送信とユーザー検証は固定)
  • Implementation classes are final; behaviour can only be changed through the SPI.実装クラスは final で、挙動の変更はSPI経由でしかできない
  • With SPAs such as keycloak-js on Keycloak ≥ 26.6.5, links without state + a matching response_mode fail with Invalid parameter: redirect_uri.keycloak-jsなどのSPAでは、Keycloak 26.6.5以降だと state と合致する response_mode を付けないリンクは Invalid parameter: redirect_uri で失敗する
  • Login Token requires prompt=login, otherwise an existing session cookie causes an "already authenticated as different user" error.Login Tokenは prompt=login が必須。付けないと既存セッションのCookieにより "already authenticated as different user" エラーになる

Requirements前提条件