# `mix ash_authentication.add_strategy.totp`
[🔗](https://github.com/team-alembic/ash_authentication/blob/main/lib/mix/tasks/ash_authentication.add_strategy.totp.ex#L7)

Adds TOTP authentication to your user resource

TOTP can be used in two modes:

  * `2fa` - As a second factor after password authentication (default)
  * `primary` - As the primary authentication method (passwordless)

Both modes use an audit log add-on for brute force protection, which will be
created automatically if one doesn't already exist.

## Example

```bash
mix ash_authentication.add_strategy.totp --mode 2fa
```

## Options

* `--user`, `-u` - The user resource. Defaults to `YourApp.Accounts.User`
* `--identity-field`, `-i` - The field on the user resource that will be used to identify
  the user. Defaults to `email`
* `--mode`, `-m` - Either `primary` or `2fa`. Defaults to `2fa`.
* `--name`, `-n` - The name of the TOTP strategy. Defaults to `totp`.

# `igniter`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
