Passwordless OTP Onboarding

How SmallPict utilizes secure, passwordless One-Time Passwords for instant WordPress site activation.

Passwordless OTP Onboarding

SmallPict eliminates traditional username/password credentials in favor of an enterprise-grade One-Time Password (OTP) authentication mechanism.

This guarantees maximum security against credential stuffing while allowing site administrators to connect their WordPress installations in seconds.


🔒 Security Architecture

The OTP verification flow uses cryptographic hashing, strict time-to-live limits, and atomic database increments:

GuardrailEnforcement Rule
Code GenerationCryptographically secure random 6-digit integer (crypto/rand)
Storage SecurityOTP codes are hashed using SHA-256 before database storage (never stored plaintext)
Expiration (TTL)Valid for 5 minutes (300 seconds) from issuance
Request CooldownMinimum 60 seconds cooldown between resend requests
Attempt LimitMaximum 3 invalid verification attempts before automatic session invalidation
IP TrackingRequesting IP is hashed and monitored for anti-bruteforce protection

🔄 The Authentication Flow

1. Requesting the OTP

When the site administrator submits their email address on the WordPress settings page, the plugin invokes the unauthenticated endpoint:

POST https://api.smallpict.app/v1/plugin/auth/request-otp

{
  "email": "admin@example.com",
  "site_url": "https://example.com",
  "consent": true
}

The SmallPict backend generates an OTP, hashes it into PostgreSQL, and dispatches an email via the high-deliverability Resend email service.

2. Verifying the Code

When the administrator enters the 6-digit code:

POST https://api.smallpict.app/v1/plugin/auth/verify-otp

{
  "email": "admin@example.com",
  "otp": "839201",
  "site_url": "https://example.com"
}

Upon successful verification, SmallPict automatically:

  1. Provisions a customer account if this is the user's first site.
  2. Generates a scoped WordPress API Key (sp_wp_...) and Secret Key.
  3. Automatically stores both keys in the local WordPress database using encrypted transients/options.

🛠️ Troubleshooting Onboarding Issues

Did not receive the verification email?

  1. Check your spam / junk folder.
  2. Wait 60 seconds and click the Resend OTP link in the setup wizard.
  3. Ensure your site's firewall allows outbound HTTPS requests to https://api.smallpict.app.

Received "Max OTP attempts reached"?

If an incorrect code is entered 3 times, the OTP session is deleted for security. Simply request a new OTP from the setup wizard.