टू-फैक्टर ऑथेंटिकेशन
दो कॉल में एक दूसरा फैक्टर जोड़ें।
Two-factor authentication adds a second proof on top of a password: a one-time code on a channel the user controls. With Bird Verify it's a send call at the moment of login and a check call when the user types the code back: SMS, WhatsApp, or email today, per-country channel config, and nothing to store between the two.
import { BirdClient } from "@messagebird/sdk";
const bird = new BirdClient({
apiKey: process.env.BIRD_API_KEY!,
});
// Send the code, then check it by recipient.
await bird.verify.verifications.create({
to: { phone_number: "+15551234567" },
}).safe();
const { data, error } = await bird.verify.verifications.check({
to: { phone_number: "+15551234567" },
code: userInput,
}).safe();
if (error) throw error;
2FA वही verification फ़्लो है, जो लॉगिन की ओर इशारा करता है।
Under the hood, 2FA is the same flow the Bird Verify API runs everywhere: create a verification for the user's phone or email when they sign in, then check the code they enter. Because the check is by recipient, your login handler keeps no per-attempt state, and the workspace's routing decides which channel a given user gets. Drop the password in front of it and the same flow becomes passwordless login.
2FA के लिए आप क्या वायर करते हैं।
दो कॉल और एक कॉन्फ़िगरेशन।
- 01
लॉगिन पर भेजें, सबमिट पर check करें।
जब यूज़र अपने पहले फैक्टर से ऑथेंटिकेट करे तो एक verification बनाएं; जब वे कोड डालें तो उसे check करें। यही पूरा इंटीग्रेशन है।
- 02
फैक्टर के रूप में SMS, WhatsApp, या email।
यूज़र के लिए जो चैनल आपके पास पहले से है उसका इस्तेमाल करें: SMS या WhatsApp पर एक फ़ोन नंबर, email पर एक email। और विकल्पों के लिए Voice रोल आउट हो रहा है।
- 03
One configuration, workspace-wide.
Routing, code rules, and channel plan live in a single configuration for the whole workspace, already covering login, signup, and high-value actions.
- 04
ब्रूट फ़ोर्स सीमित है।
प्रयास लॉकआउट और प्रति-recipient send कैप बिल्ट-इन आते हैं, ताकि एक दूसरा फैक्टर नया अटैक सरफेस न बन जाए।
लॉगिन-टाइम फ़्लो।
पासवर्ड सही निकलते ही कोड भेजें; जब यूज़र सबमिट करे तो उसे वेरिफ़ाई करें। गलत कोड एक ऐसा रिज़ल्ट है जिस पर आप ब्रांच करते हैं, कोई एक्सेप्शन नहीं जिसे कैच करना पड़े।
// Send the second factor once the password checks out.
await bird.verify.verifications.create({
to: { phone_number: user.phone },
}).safe();
const { data, error } = await bird.verify.verifications.check({
to: { phone_number: user.phone },
code: submitted,
}).safe();
if (error) throw error;
if (data.success) grantSession(user);
इसे Verify प्लेटफ़ॉर्म पर बनाएं
आपके 2FA फ़्लो के पीछे के चैनल और कंट्रोल।
टू-फैक्टर ऑथेंटिकेशन, आपके बाकी चैनलों वाले उसी API पर।
Bird Verify is the code-based factor for your login and signup: SMS, email, and WhatsApp now, voice rolling out.