---
title: "How to Build Passwordless Auth Using TOTP With Twilio Verify in PHP"
description: "Passwordless authentication can replace passwords with time-based one-time passwords (TOTP), but implementing the setup and verification flow requires coordinating an authenticator app with a verification service. This tutorial builds a web-based PHP application using Twilio Verify, Slim, Twig, and the Twilio PHP Helper Library. Users submit a username, create an initially unverified Factor resource, scan a QR code or enter its setup code, and submit the first six-digit code; later, they enter codes generated by the authenticator app for validation. The project configures Twilio credentials and a Verify Service SID through environment variables, adds session and flash-message support, generates QR codes, defines routes and templates, and runs locally with composer serve on port 8080. The conclusion presents TOTP passwordless authentication as more convenient and potentially more secure than passwords, while acknowledging added application complexity."
---

# How to Build Passwordless Auth Using TOTP With Twilio Verify in PHP

[Twilio](https://yomu.fyi/company/twilio) · Matthew Setter · Aug 18, 2026

**Type:** Tutorial

## Summary

Passwordless authentication can replace passwords with time-based one-time passwords (TOTP), but implementing the setup and verification flow requires coordinating an authenticator app with a verification service. This tutorial builds a web-based PHP application using Twilio Verify, Slim, Twig, and the Twilio PHP Helper Library. Users submit a username, create an initially unverified Factor resource, scan a QR code or enter its setup code, and submit the first six-digit code; later, they enter codes generated by the authenticator app for validation. The project configures Twilio credentials and a Verify Service SID through environment variables, adds session and flash-message support, generates QR codes, defines routes and templates, and runs locally with composer serve on port 8080. The conclusion presents TOTP passwordless authentication as more convenient and potentially more secure than passwords, while acknowledging added application complexity.

## Context

Typing or generating unique passwords for accounts and websites is described as a hassle. The tutorial presents passwordless authentication as an alternative intended to reduce password-related risk, eliminate password management, and streamline login.

## Approach / What changed

The application uses Twilio Verify to create and verify TOTP Factor resources. It configures credentials through environment variables, generates a QR code for authenticator setup, validates the initial six-digit code, and provides routes and forms for validating later codes in a PHP web application.

## Takeaways

- Twilio Verify initially creates a Factor resource as unverified; it becomes verified after the authenticator-generated setup code is validated.
- The PHP project uses chillerlan/php-qrcode, PHP dotenv, Slim session and flash components, Twig views, and Twilio's PHP Helper Library.
- The application can be run locally with composer serve on port 8080, where users complete setup and later validate six-digit TOTP codes.

**Tags:** [Authentication](https://yomu.fyi/topic/authentication), [PHP](https://yomu.fyi/topic/php), [Twilio](https://yomu.fyi/topic/twilio)

- Source: [Twilio](https://www.twilio.com/en-us/blog/developers/tutorials/product/build-passwordless-auth-using-totp-with-twilio-verify-php)
- Source URL: https://www.twilio.com/en-us/blog/developers/tutorials/product/build-passwordless-auth-using-totp-with-twilio-verify-php
- Ingested by Yomu: 2026-09-09T13:34:49.156Z

[Read original post](https://www.twilio.com/en-us/blog/developers/tutorials/product/build-passwordless-auth-using-totp-with-twilio-verify-php)
