Backup codes

When you link a user's iPhone for push, you can also put your own authenticator (TOTP) enrollment for that user into Trowyn. The user then has a 6-digit backup code in Trowyn for when push can't reach them (no signal, notifications off, Trowyn's service unavailable), and you verify it like any TOTP code.

How it works

  1. You enroll the user in TOTP as you normally would and get their otpauth://totp/… URI (for example otpauth://totp/Acme:ana@acme.example?secret=JBSWY3DPEHPK3PXP&issuer=Acme).
  2. You create a link code as usual (POST /create-link-code).
  3. On your side, you add the URI to the link as the t parameter (percent-encoded with encodeURIComponent): - link_url: https://trowyn.com/link#c=…&n=…&t=<encoded URI> (in the fragment) - qr_payload: trowyn://link?v=1&h=…&c=…&n=…&t=<encoded URI>

The server SDK does this for you: createLinkCode({ …, backupOtpauthUri }) or withBackupCode(link, uri). In the console, Phones → Link a phone → Backup code does it in your browser. 4. You show that link as a QR code on a page where the user is already signed in. 5. The user scans it. Trowyn shows "Also add a backup code" (on by default) next to the link confirmation. After the link succeeds, the code is saved on the iPhone like any other account, tagged #Push, and the linked company shows it has a backup code.

Security

Compatibility

t is optional and the API is unchanged. Links without it work everywhere. Links with it need a Trowyn version with backup-code support (older versions refuse the longer link with "That QR code isn't a Trowyn link code").