Sign inSign up

codedefective/totp

By codedefective

•Updated 5 months ago

TOTP Generator API

Image
0

291

codedefective/totp repository overview

⁠🔐 TOTP Generator API

A simple and lightweight Time-based One-Time Password (TOTP) generator API built with FastAPI.


⁠🚀 Quick Start

docker run -p 7474:80 codedefective/totp

Or with Docker Compose:

docker compose up -d

docker-compose.yml:

services:
  totp:
    image: codedefective/totp
    build: .
    ports:
      - "7474:80"

⁠📡 API Reference

⁠POST /

Returns the current TOTP code for the given OTP key.

Request:

{
  "OtpKey": "JBSWY3DPEHPK3PXP"
}

Response:

{
  "val": "524773"
}

cURL example:

curl -X POST "http://localhost:7474/" \
  -H "Content-Type: application/json" \
  -d '{"OtpKey": "JBSWY3DPEHPK3PXP"}'

⁠🍎 Apple Shortcuts

Use this API directly from your iPhone or Mac.

📲 Download Example Shortcut⁠



⁠📝 Notes

  • TOTP codes refresh every 30 seconds (RFC 6238 standard).
  • OtpKey must be in Base32 format.
  • Compatible with Google Authenticator, Authy, and similar apps.

⁠📄 License

MIT — see LICENSE⁠ on GitHub.

Tag summary

Content type

Image

Digest

sha256:fd1f3a524…

Size

73.7 MB

Last updated

5 months ago

docker pull codedefective/totp