# Admins and passkeys

_For tartan 0.9.36._

People sign in with passkeys, and a change is made only from an approved admin device.

People sign in with passkeys, and a change is made only from an approved admin device.

## How a change is approved

- **Passkeys, no passwords.** Each person makes their passkey when they join. Tartan stores public keys only.
- **Reads**, such as a `list` or a `show`, need only the sign-in. `tartan edge converge`, which checks every gateway and
  relay now, is a change: it steps up every time.
- **Changes** need an **admin device**: the computer must be approved for changes in the organization. A computer new
  to the organization can read at once. Its changes are refused until an Admin approves it, unless the person's
  invite approved it or the organization's SSO sign-in approves admin computers.
- **Step-ups.** When a command steps up, the CLI shows the change in words, and your passkey approves that exact
  change. Add `--dry-run` to a command that has one to see the change with no prompt and no change.
- **Fewer prompts.** `tartan batch run --file <file>` runs 2 to 20 changes in your organization; when it steps up, one
  passkey prompt approves them all. It shows every line first; `--dry-run` stops before the prompt.

## 1. Approve a computer

In the console, open **Approvals** and choose **Admin devices**, then **Approve** (or **Deny**).

With the CLI, your passkey approves it:

```sh
tartan admin-device list --org acme
tartan admin-device approve --org acme --kid <kid>
```

A tech's computer usually waits for two approvals: as an admin device, and for tech connect. One step-up approves
both, and your passkey approves it:

```sh
tartan approval pairs --org acme
tartan approval approve-pair --org acme --approval <tech request id> --kid <admin device kid>
```

A pairing groups one person's requests by the name the computer reports, and the name proves nothing. Check with the
person that the computer is theirs, by its identifier, before you approve.

## 2. Change a role

In the console, pick the person on **People** and choose their new role. With the CLI, your passkey approves each
change.

```sh
tartan role list --org acme
tartan role bind --org acme --user <user id> --role admin
tartan role unbind --org acme --user <user id> --role admin
```

`role bind` and `role unbind` give and take **admin**, **tech** or **viewer**. Making or removing an Admin tells the
organization's Owners. An Owner comes only by an Owner's invite.

## 3. A lost computer or a lost passkey

A lost or stolen computer: revoke it as an admin device. Your passkey approves it.

```sh
tartan admin-device revoke --org acme --kid <kid>
```

A new computer for someone who already has an account: a one-time invite code that adds a passkey and device to
them. The code goes only to that person, and the new device then waits for an approval.

```sh
tartan user add-device --org acme --user <user id>
```

The answer shows the code once, as `invite`. On the new computer, the person runs this with it and makes a passkey
there:

```sh
tartan signup --invite <code>
```

Then an Admin approves the new computer (step 1).

A lost phone or security key: remove that one passkey. Their sessions end. It is never their last passkey (add a
device first) and never an Owner's passkey.

```sh
tartan user passkey list --org acme --user <user id>
tartan user passkey remove --org acme --user <user id> --credential <credential id>
```

Each of these is its own passkey prompt.

## The Owner's passkey

An Owner signs in with their passkey alone, never with SSO. Keep the Owner passkey for Owner acts, invite yourself
as an Admin, and work day to day as that Admin.

If you saved the Owner passkey in a passkey manager, rename the item to `Owner · Tartan · <org>`. The CLI prints the
same reminder: the manager names every item after the website.

## Check it worked

```sh
tartan admin-device list --org acme
tartan role list --org acme
```

An approved computer shows as approved, and the person's next change goes through. `role list` shows every binding,
direct or from an SSO rule.

## Next

- [Invite people](invite-people.md)
- [SSO with Entra](sso-entra.md)
- [The audit log](audit-log.md)
