Tinyauth

パスキー

Tinyrack Authから WebAuthn/パスキー認証を構成する

パスキーはパスワードなしでバイオメトリックです。 PINを使って安全にログインできる次世代認証手段です。 WebAuthn/FIDO2 標準に基づいており、フィッシングに強く、ユーザー体験に優れています。設定例は次のとおりです。

# config.yaml
server:
  public_origin: https://auth.example.com

auth:
  passkey:
    enabled: true
    rp_id: example.com
    origins:
      - https://auth.example.com
      - https://login.example.com
  • enabled:パスキー認証を有効にするかどうか。デフォルトは falseはい。
  • rp_id: WebAuthn Relying Party IDです。プロトコル(https://)またはポート(:8080)を除くドメインのみを入力する必要があります。指定しない場合 server.public_originのホスト名から自動的に抽出されます。親ドメインを指定すると、サブドメイン間でパスキーを共有できます。
  • origins: WebAuthn 検証に許可するソース(origin)のリストです。指定しない場合 server.public_origin 値が基本として使用されます。複数のドメインで同じパスキーを使用する必要がある場合に便利です。
Caution

パスキーはセキュリティ上の理由から https プロトコルでのみ正常に動作します(localhostは例外)。本番環境では必ず httpsを使用してください。


tinyauthhttps://auth.example.comで運営し、 example.comのすべてのサブドメインでパスキーを共有するには、次のように設定できます。

# config.yaml
server:
  public_origin: https://auth.example.com

auth:
  passkey:
    enabled: true
    rp_id: example.com
    origins:
      - https://auth.example.com

単一ドメインでのみパスキーを使用する場合、 rp_idoriginsを省略すると server.public_originで自動的に設定されます。

# config.yaml
server:
  public_origin: https://auth.example.com

auth:
  passkey:
    enabled: true