VerifyBlind'i bir web sitesine nasıl entegre edeceğinizi gösteren örnek (Next.js, App Router).
example-web-php ve example-web-dotnet ile aynı akışın Next.js sürümüdür.
- Sunucu-taraflı proxy — Tarayıcı
POST /api/generateçağırır; sunucuX-API-Key'i ekleyip VerifyBlindPOST /api/pop/generate'e iletir ve birnoncedöner. API anahtarı tarayıcıya hiç gösterilmez. (src/app/api/generate/route.ts) - Doğrulama — Kullanıcı QR'ı VerifyBlind mobil ile okutur (
src/app/send2mobile/); doğrulama bitince partner'a imzalı bir token döner. - İmza kontrolü —
POST /api/verifytoken'ı alır,GET /api/public/enclave-keyile enclave'in public key'ini çekip RSA-PSS imzasını doğrular ve nonce'u tek-kullanımlık tüketir. (src/app/api/verify/route.ts)
npm install
# .env.local oluşturun:
# TEST_VERIFYBLIND_API_KEY=<partner API anahtarınız>
# VERIFYBLIND_API_URL=https://api.verifyblind.com # varsayılan
npm run dev # http://localhost:3000Demo nonce deposu tek-instance içindir; üretimde Redis/DB kullanın (
src/lib/redis.ts).
🌐 verifyblind.com · 🧩 PHP örneği · 🧩 .NET örneği
An example of integrating VerifyBlind into a website (Next.js, App Router). It is the Next.js version of
the same flow as example-web-php and example-web-dotnet.
- Server-side proxy — The browser calls
POST /api/generate; the server adds theX-API-Keyand forwards it to VerifyBlindPOST /api/pop/generate, returning anonce. The API key is never exposed to the browser. (src/app/api/generate/route.ts) - Verification — The user scans the QR with VerifyBlind mobile (
src/app/send2mobile/); on success a signed token is returned to the partner. - Signature check —
POST /api/verifytakes the token, fetches the enclave public key viaGET /api/public/enclave-key, verifies the RSA-PSS signature, and consumes the nonce once. (src/app/api/verify/route.ts)
npm install
# Create .env.local:
# TEST_VERIFYBLIND_API_KEY=<your partner API key>
# VERIFYBLIND_API_URL=https://api.verifyblind.com # default
npm run dev # http://localhost:3000The demo nonce store is single-instance only; use Redis/DB in production (
src/lib/redis.ts).
🌐 verifyblind.com · 🧩 PHP example · 🧩 .NET example