Skip to content

Account recovery

This page tells you what to do when a user cannot sign in: a lost phone, a forgotten password, or nobody who can sign in at all.

MicroB2B has no “forgot password” link and sends no e-mail. Another user, or an administrator on the server, resets the account and hands over a new setup link.

A user lost their phone

With recovery codes:

  1. The user signs in with their name and password.
  2. On the code step, they click Use a recovery code instead and enter one of their recovery codes.
  3. They open Your account (their name in the page header).
  4. Under Authenticator, they scan the new QR code with their new phone, enter their password and a code, and click Use this authenticator.
  5. They store the new recovery codes that MicroB2B shows.

Without recovery codes:

  1. Another user opens the user on Access > Users and clicks Reset authenticator.
  2. MicroB2B shows a new setup link once. Give it to the user.
  3. The user opens the link. The setup page asks for their password first, then sets up the new authenticator.

On the command line, step 1 is:

microb2b users reset-totp jane

A user forgot their password

  1. Another user opens the user on Access > Users and clicks Reset password.
  2. Give the new setup link to the user.
  3. The user opens the link. The setup page asks for a code from their authenticator app (or a recovery code) first. Then they choose a new password.

On the command line:

microb2b users reset-password jane

A user lost both

Use Reset both, or microb2b users reset jane. The setup link then asks for nothing that the user had. Make sure you give the link to the right person.

Why the setup page asks for the kept credential

A reset of one credential keeps the other. The setup page asks for the kept one before it changes anything. So someone who only intercepts the setup link cannot take over the account.

A setup link expired or was lost

A setup link works once and for 24 hours. Reset the user again to get a new link. The new link replaces any earlier one.

Nobody can sign in

This can happen when:

  • the only administrator is locked out,
  • every user is disabled,
  • the identity provider is down or gone.

Access to the server and its database is the last way in. On the server, run microb2b users with the same database settings as MicroB2B (DB_TYPE, DB_URL). Set PUBLIC_URL too, so it prints a whole link.

PUBLIC_URL=https://b2b.example.com DB_URL=file:/var/lib/microb2b/microb2b.db \
  microb2b users reset admin

Choose the command that fits:

SituationCommand
A password user lost their credentialsmicrob2b users reset <name>
The user is disabledmicrob2b users enable <name>
A single sign-on user needs a way in without the providermicrob2b users password-login <name> on
You want a fresh usermicrob2b users create <name>

Then open the printed link in a browser and finish the setup. MicroB2B does not need to be stopped for this.

Be ready before it happens

  • Keep a break-glass account. If your users sign in through an identity provider, keep one user with password login on. Store its password and recovery codes somewhere safe and offline. See users.
  • Tell users to keep their recovery codes away from their phone.
  • Keep at least two people who can sign in, so one can reset the other.
  • Keep shell access to the server documented. It is the last way in.

MicroB2B already refuses to disable, delete or turn password login off for the last user who can sign in, unless you force it on the command line. See users.

Recovering keys and data

This page is about user accounts. To recover the private keys of your certificates without MicroB2B, see secrets recovery.