mix ash_authentication.add_strategy.webauthn (ash_authentication v5.0.0-rc.7)

Copy Markdown View Source

Adds WebAuthn/Passkey authentication to your user resource

Creates a credential resource and adds the WebAuthn strategy to the user resource. Users can sign in with hardware security keys (YubiKey), platform authenticators (Touch ID, Windows Hello), or passkeys.

Example

mix ash_authentication.add_strategy.webauthn --rp-id example.com --rp-name "My App"

Options

  • --user, -u - The user resource. Defaults to YourApp.Accounts.User.
  • --identity-field, -i - The field on the user resource that identifies the user (typically email). Defaults to email.
  • --name, -n - The strategy name. Defaults to webauthn.
  • --rp-id - The Relying Party ID (your domain, e.g. example.com). Required.
  • --rp-name - The Relying Party display name shown to the user during registration. Required.
  • --origin - The full origin URL (e.g. https://example.com or https://localhost:4001). Optional — defaults to https://{rp_id}, which omits the port and is wrong for non-standard dev ports.

Summary

Functions

igniter(igniter)

Callback implementation for Igniter.Mix.Task.igniter/1.