If your are looking for OTP verification service for your landing pages, then you have come to right place!!. We provide One Time Password verification service which you can use according to your use case, may it be OTP over phone or OTP over email. With increased cyberattacks, every company and individual is looking for a way they can protect their data and resources. miniOranges' OTP verification service can help them achieve security without any additional associated costs. miniOrange provides OTP verification service for landing pages, that they can integrate with our OTP generate REST API and an OTP validate REST API to their landing pages for providing secure login to customers' data and resources. You can also use OTP verification service for lead generation of your business on pay per use basis.
Features:
Email Address Verification
Phone Number Verification
$99 - One Time Payment
+
[ This is for your own SMS/SMTP gateway ]
[ You can refill at anytime ]
[ To use miniOrange SMS/SMTP gateway, Contact Us* ]
Features:
Email Address Verification
Phone Number Verification
Custom Email Template
Custom SMS Template
Custom SMS/SMTP Gateway
$199 - One Time Payment
+
[ This is for your own SMS/SMTP gateway ]
[ You can refill at anytime ]
[ To use miniOrange SMS/SMTP gateway, Contact Us* ]
Features:
Email Address Verification
Phone Number Verification
Custom Email Template
Custom SMS Template
Custom SMS/SMTP Gateway
Custom Integration/Work
Benefits of using OTP verification page Service:
Step 1: Sign Up with us
You can sign up for free trial click here
Login to miniOrange dashboard with login credentials that you will receive in email.
Step 2: Get your Customer Keys from miniOrange
After login into miniOrange, go to Integrations -> Custom App Integration
Copy your Customer Key and Customer API Key that you will require in next steps.
Step 3: Calling our Generate OTP rest API
To generate an OTP, you need to make a HTTP POST request to our Generate Rest API. Our Generate Rest API accepts the JSON input in the following format:.
/* JSON Object format for OTP generation request */
{
"customerKey":"123456", /* The Customer Key from Step 2 above */
"user": {
"phone":"1234567890", /* Phone number to send OTP */
"name":"abc"
},
"transactionName":"Transaction Name",
"address":"350 Park Avenue, New York",
"company":"company name",
"website":"www.example.com",
"comment":"lorem ipsum sit amet consectetur",
"additionalFields":{ /* you can store additional data for leads */
"field1":"additional_field_value1",
"field2":"additional_field_value2",
"field3":"additional_field_value3",
"field4":"additional_field_value4"
}
}
Attribute | Description |
---|---|
customerKey * | The Customer Key from Step 2 above |
phone * | Phone number to send OTP. |
name | Name of the lead. |
transactionName | Any transaction details that you would like to send to user to give information about the transaction. (Max limit 30 characters) |
address | Address of the Lead. |
company | Company Name of the Lead. |
website | Website of the Lead. |
comment | Comment by the Lead. |
additionalFields | You can store upto 4 additional lead parameters in field1, field2, field3 and field4. |
Sample Code for calling our Generate OTP rest APIs :
/* Function to send OTP over SMS */
function callGenerateRestApi($customerKey, $endUserPhone, $userName, $transactionName, $address,
$company, $website, $comment, $field1, $field2, $field3, $field4)
{
$URL = 'https://login.xecurify.com/moas/rest/generate-otp';
/* The Customer Key from Step 2 above */
$customerKey = "";
/* The Customer API Key from Step 2 above */
$apiKey = "";
/* Current time in milliseconds since midnight, January 1, 1970 UTC. */
$currentTimeInMillis = round(microtime(true) * 1000);
/* Creating the Hash using SHA-512 algorithm */
$stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
$hashValue = hash("sha512", $stringToHash);
/* The Array containing the request information */
$jsonRequest = array("customerKey" => $customerKey,
"user" => array( "phone"=> $endUserPhone,"name" => $userName),
"transactionName" => $transactionName,
"address" => $address,
"company" => $company,
"website" => $website,
"comment" => $comment,
"additionalFields" => array("field1" => $field1, "field2" => $field2, "field3" => $field3, "field4" => $field4)
);
/* JSON encode the request array to get JSON String */
$jsonRequestString = json_encode($jsonRequest);
$customerKeyHeader = "Customer-Key: " . $customerKey;
$timestampHeader = "Timestamp: " . $currentTimeInMillis;
$authorizationHeader = "Authorization: " . $hashValue;
/* Initialize curl */
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $customerKeyHeader,
$timestampHeader, $authorizationHeader));
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonRequestString );
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
}
$response = (array)json_decode($result);
if(isset($response['phoneDelivery']))
{
$phoneDelivery = (array)$response['phoneDelivery'];
if(isset($phoneDelivery['sendStatus']) && $phoneDelivery['sendStatus']=="SUCCESS")
return 1;
}
return 0;
}
/* End Of Function */
public String callGenerateRestApi() {
/* The generation rest api url which needs to be called to generate the OTP */
String generateUrl = "https://login.xecurify.com/moas/rest/generate-otp";
/* The Customer Key from Step 2 above */
String customerKey = "";
/* The Customer API Key from Step 2 above */
String apiKey = "";
/* Current time in milliseconds since midnight, January 1, 1970 UTC. */
String currentTimeInMillis = String.valueOf(System.currentTimeMillis());
/* Creating the Hash using SHA-512 algorithm (Apache Shiro library) */
String stringToHash = customerKey + currentTimeInMillis + apiKey;
String hashValue = new Sha512Hash(stringToHash).toHex().toLowerCase();
/* The JSON string containing the request information */
String jsonRequestString = "{\"customerKey\":\"" + customerKey + "\",\"user\":{\"phone\":\"123456\"}}";
/* Initializing default Http Client */
HttpClient httpClient = new DefaultHttpClient();
HttpPost postRequest = new HttpPost(generateUrl);
/* Setting jsonRequestString as StringEntity */
StringEntity input = new StringEntity(jsonRequestString);
input.setContentType("application/json");
postRequest.setEntity(input);
/* Setting the Authorization Header values */
postRequest.setHeader("Customer-Key", customerKey);
postRequest.setHeader("Timestamp", currentTimeInMillis);
postRequest.setHeader("Authorization", hashValue);
/* Calling the rest API */
HttpResponse httpResponse = httpClient.execute(postRequest);
/* If invalid response is received, throwing a Runtime Exception */
if (httpResponse.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Invalid response received from authentication server. HTTP error code: "
+ response.getStatusLine().getStatusCode());
}
/* If a valid response is received, get the JSON response string */
BufferedReader br = new BufferedReader(new InputStreamReader((httpResponse.getEntity().getContent())));
String output, jsonResponseString = "";
while ((output = br.readLine()) != null) {
jsonResponseString += output;
}
httpClient.getConnectionManager().shutdown();
return jsonResponseString;
}
function callGenerateRestApi(customerKey, endUserPhone, userName, transactionName, address, company,
website, comment, field1, field2, field3, field4) {
/* The JSON String containing the request information */
var jsonData = {
"customerKey": customerKey,
"user": { "phone" : endUserPhone, "name" : userName },
"transactionName" : transactionName,
"address" : address,
"company" : company,
"website" : website,
"comment" : comment,
"additionalFields" : { "field1" : field1, "field2" : field1, "field3" : field1, "field4" : field1}
}
/* Calling the rest API with AJAX */
$.ajax({
url: 'https://login.xecurify.com/moas/rest/generate-otp',
type: 'post',
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (data) {
if(data.phoneDelivery.sendStatus=="SUCCESS")
{
/* OTP Successfully sent. */
} else {
/* There was an error sending OTP. */
}
},
data: JSON.stringify(jsonData)
});
}
Step 4: Calling our Validate OTP rest API
To validate an OTP, you need to make a HTTP POST request to our Generate Rest API. Our Validate Rest API accepts the JSON input in the following format:.
/* JSON Object format for OTP validation request */
{
"customerKey":"123456", /* The Customer Key from Step 2 above */
"user": {
"phone":"1234567890", /* Phone number to validate */
},
"otpToken":"000000", /* OTP code entered by lead */
}
Sample Code for calling our Validate OTP rest APIs :
/* Function to validate OTP */
function callValidateRestApi($customerKey,$endUserPhone,$otpToken)
{
$URL = 'https://login.xecurify.com/moas/rest/validate-otp';
/* The Customer Key from Step 2 above */
$customerKey = "";
/* The Customer API Key from Step 2 above */
$apiKey = "";
/* Current time in milliseconds since midnight, January 1, 1970 UTC. */
$currentTimeInMillis = round(microtime(true) * 1000);
/* Creating the Hash using SHA-512 algorithm */
$stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
$hashValue = hash("sha512", $stringToHash);
/* The Array containing the request information */
$jsonRequest = array("customerKey" => $customerKey,
"user" => array( "phone"=> $endUserPhone),
"otpToken"=>$otpToken);
/* JSON encode the request array to get JSON String */
$jsonRequestString = json_encode($jsonRequest);
$customerKeyHeader = "Customer-Key: " . $customerKey;
$timestampHeader = "Timestamp: " . $currentTimeInMillis;
$authorizationHeader = "Authorization: " . $hashValue;
/* Initialize curl */
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $customerKeyHeader,
$timestampHeader, $authorizationHeader));
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, jsonRequestString );
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
}
$response = (array)json_decode($result);
if(isset($response['statusCode']) && $response['statusCode']=="SUCCESS" )
{
return 1;
}
return 0;
}
/* End Of Function */
public String callValidateRestApi() {
/* The validation rest api url which needs to be called to validate the OTP */
String generateUrl = "https://login.xecurify.com/moas/rest/validate-otp";
/* The Customer Key from Step 2 above */
String customerKey = "";
/* The Customer API Key from Step 2 above */
String apiKey = "";
/* Current time in milliseconds since midnight, January 1, 1970 UTC. */
String currentTimeInMillis = String.valueOf(System.currentTimeMillis());
/* Creating the Hash using SHA-512 algorithm (Apache Shiro library) */
String stringToHash = customerKey + currentTimeInMillis + apiKey;
String hashValue = new Sha512Hash(stringToHash).toHex().toLowerCase();
/* The JSON string containing the request information */
String jsonRequestString = "{\"customerKey\":\"" + customerKey + "\",\"user\":{\"phone\":\"123456\"}, \"otpToken\":\"000000\" }";
/* Initializing default Http Client */
HttpClient httpClient = new DefaultHttpClient();
HttpPost postRequest = new HttpPost(generateUrl);
/* Setting jsonRequestString as StringEntity */
StringEntity input = new StringEntity(jsonRequestString);
input.setContentType("application/json");
postRequest.setEntity(input);
/* Setting the Authorization Header values */
postRequest.setHeader("Customer-Key", customerKey);
postRequest.setHeader("Timestamp", currentTimeInMillis);
postRequest.setHeader("Authorization", hashValue);
/* Calling the rest API */
HttpResponse httpResponse = httpClient.execute(postRequest);
/* If invalid response is received, throwing a Runtime Exception */
if (httpResponse.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Invalid response received from authentication server. HTTP error code: "
+ response.getStatusLine().getStatusCode());
}
/* If a valid response is received, get the JSON response string */
BufferedReader br = new BufferedReader(new InputStreamReader((httpResponse.getEntity().getContent())));
String output, jsonResponseString = "";
while ((output = br.readLine()) != null) {
jsonResponseString += output;
}
httpClient.getConnectionManager().shutdown();
return jsonResponseString;
}
function callValidateRestApi(customerKey, endUserPhone, otpToken) {
/* The JSON String containing the request information */
var jsonData = {
"customerKey": customerKey,
"user": { "phone" : endUserPhone},
"otpToken" : otpToken
}
/* Calling the rest API with AJAX */
$.ajax({
url: 'https://login.xecurify.com/moas/rest/validate-otp',
type: 'post',
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (data) {
if(data.statusCode=="SUCCESS"){
/* OTP Successfully Validated. */
} else {
/* Invalid OTP Token. */
}
},
data: JSON.stringify(jsonData)
});
}
miniOrange provides 24/7 support for all the Secure Identity Solutions. We ensure high quality support to meet your satisfaction.
Try Nowminiorange provides most affordable Secure Identity Solutions for all type of use cases and offers different packages based on customer's requirement.
Request A QuoteWe offer Secure Identity Solutions for Single Sign-On, Two Factor Authentication, Adaptive MFA, Provisioning, and much more. Please contact us at -
+1 978 658 9387 (US) , +91 97178 45846 (India) | info@xecurify.com