Adds the provided strategy or strategies to your user resource
This task will add the provided strategy or strategies to your user resource.
The following strategies are available. For all others, see the relevant documentation for setup
password- Register and sign in with a username/email and a password.magic_link- Register and sign in with a magic link, sent via email to the user.otp- Sign in with a short one-time password sent via email or SMS.api_key- Sign in with an API key.totp- Authenticate with a time-based one-time password (TOTP).recovery_code- Authenticate with one-time recovery codes as a 2FA fallback.github- Sign in with GitHub.google- Sign in with Google.apple- Sign in with Apple.auth0- Sign in with Auth0.microsoft- Sign in with Microsoft.okta- Sign in with Okta.slack- Sign in with Slack.oidc- Sign in with a generic OpenID Connect provider.oauth2- Sign in with a generic OAuth2 provider.webauthn- Sign in with a WebAuthn/Passkey credential.
Each strategy can also be added directly with its own task:
mix ash_authentication.add_strategy.passwordmix ash_authentication.add_strategy.magic_linkmix ash_authentication.add_strategy.otpmix ash_authentication.add_strategy.api_keymix ash_authentication.add_strategy.totp
Example
mix ash_authentication.add_strategy password
Options
--user,-u- The user resource. Defaults toYourApp.Accounts.User--identity-field,-i- The field on the user resource that will be used to identify the user. Defaults toemail
Password options
hash-provider- The hash provider to use, eitherbcryptorargon2. Defaults tobcrypt.
TOTP options
--mode,-m- Eitherprimaryor2fa. Defaults to2fa.--name,-n- The name of the TOTP strategy. Defaults tototp.
Summary
Functions
Callback implementation for Igniter.Mix.Task.igniter/1.
Functions
Callback implementation for Igniter.Mix.Task.igniter/1.