Skip to main content

Verify One-Time Passcode

Use the BlockID SDK to verify the six-digit one-time passcode you received via SMS or email.

Verify One-Time Passcode​

You can verify an OTP request immediately after receiving your six-digit one-time passcode.

Please Note:

Each one-time passcode is only valid for a single verification. Submitting an incorrect one-time passcode more than five times in 24 hours will result in a 30-minute account lockout.

Parameters​

  • dns: Your tenant domain as shown in the dashboard
  • communityName: Your tenant communnity name as shown in the dashboard
  • licenseKey: Your tenant license key as shown in the dashboard
  • username: BlockID username
  • otpCode: Six-digit one-time passcode you received

Verification Format​

  • Set tenant info and verify OTP
const BIDOTP = require('blockid-nodejs-helpers/BIDOTP');

let verifyOtpResponse = await BIDOTP.verifyOTP({ "dns": "<dns>", "communityName": "<communityName>", "licenseKey": "<licenseKey>" }, "<username>", "<otpCode>");

Example OTP Verification​

We've provided some example OTP verifications using the BlockID SDK.

Please note that these are just examples - a typical use-case would be to require verification of a one-time passcode as part of a sign-in request.

Verify a one-time passcode request using the six digits you received via email or SMS.

Example OTP Request - SMS​

Example SMS containing six-digit one-time passcode.

OTP SMS

Example OTP Verifcation​

const BIDOTP = require('blockid-nodejs-helpers/BIDOTP');

let verifyOtpResponse = await BIDOTP.verifyOTP({ "dns": "blockid-trial.1kosmos.net", "communityName": "devx", "licenseKey": "0005c9f8-1918-40be-aa00-e319043f7xxx" }, "[email protected]", "062423");

Verify a request with the six-digit one-time passcode you received via SMS or email.

Example Server Responses​

The SDK will return an immediate response from our API. The responses are the same across each SDK and are JSON formatted. Possible response codes you might receive include:

Server Response​

200 OK

{
"messageId":"15f9dd86-9a8a-4c66-900a-f711f5acceb1",
"info":"OTP request verified"
}

The one-time passcode was verified and accepted.