In today's fast-paced world, convenience and security are paramount when it comes to online transactions and interactions. One of the latest innovations in the realm of user authentication is the "Sign in with Phone" feature, which enables users to access merchant websites and dashboards effortlessly using their mobile numbers. This convenient and secure login method streamlines the user experience while ensuring data protection. In this article, we'll explore the benefits of "Sign in with Phone," how it works, and how merchants can implement it on their websites.
Implementing "Sign in with Phone" on your merchant website is straightforward and can be accomplished in a few simple steps.
Login Button Code Snippet
<button
style="display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; background-color: #02BD7E; font-weight: bold; color: #ffffff; border: none; border-radius: 3px; font-size: inherit;cursor:pointer;"
id="btn_ph_login"
name="btn_ph_login"
type="button"
onclick="window.open('https://auth.phone.email/sign-in?countrycode=$COUNTRY_CODE&phone_no=$PHONE_NO&redirect_url=$REDIRECT_URL', 'peLoginWindow', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0, width=500, height=500, top=' + (screen.height - 500) / 2 + ', left=' + (screen.width - 500) / 2);"
>
<svg
xmlns="http://www.w3.org/2000/svg"
style="margin-right: 5px; fill: #ffffff"
height="24"
viewBox="0 -960 960 960"
width="24"
>
<path d="M798-120q-125 0-247-54.5T329-329Q229-429 174.5-551T120-798q0-18 12-30t30-12h162q14 0 25 9.5t13 22.5l26 140q2 16-1 27t-11 19l-97 98q20 37 47.5 71.5T387-386q31 31 65 57.5t72 48.5l94-94q9-9 23.5-13.5T670-390l138 28q14 4 23 14.5t9 23.5v162q0 18-12 30t-30 12Z"/>
</svg>
Sign in with Phone Number
</button>
JWT decode snippet
<?php
require 'vendor/autoload.php';
use Firebase\JWT\JWT;
use Firebase\JWT\Key;
if(isset($_GET['phtoken'])){
try {
$api_key = 'API_KEY'; // Please specify API key provided by Phone Email mobile application
$decoded = JWT::decode($_GET['phtoken'], new Key($api_key, 'HS256'));
$jwt_response = 1; // JWT decoded successfully
$jwt_phone = $decoded->country_code.$decoded->phone_no; // You will get user phone number here from JWT
} catch (Exception $e) {
$jwt_response = 0; // Invalid JWT
$jwt_phone = '';
}
}else{
$jwt_response = 0; // Invalid JWT
$jwt_phone = '';
}
?>
In conclusion, "Sign in with Phone" is a game-changer in the world of user authentication, offering both convenience and security to users and merchants alike. By integrating this feature into your website or dashboard, you can streamline the login process, enhance security, and improve the overall user experience. Embrace this innovative solution to stay ahead in the competitive digital landscape and offer your users a hassle-free and secure way to access their accounts.
Related Posts
In today's digital age, communication has evolved significantly. From the traditional methods of sending letters and making phone calls, we have moved on to emails, instant messaging apps, and social media. However, one aspect of communication has remained relatively unchanged: the need for email addresses. But what if there was a way to send and receive emails using just a phone number? Enter the Phone Email App, a groundbreaking solution that's changing the way we think about email communication.
Phone Email's OTP Verification is a powerful tool that can help businesses bolster their security, reduce bounce rates, build user trust, and optimize the user experience. Prioritizing data security and simplifying OTP delivery, Phone Email is the go-to solution for businesses seeking success in the digital world, where trust, efficiency, and customer satisfaction reign supreme.
In today's digital age, email communication has become an integral part of our personal and professional lives. However, the complexity and limitations of traditional email addresses can often be a source of frustration. But fear not! Phone.Email, a cutting-edge email provider, is here to revolutionize the way we send and receive emails. With its Android app and innovative features, Phone.Email simplifies email communication by allowing users to send emails using phone numbers instead of complex email IDs. Let's delve deeper into the benefits of Phone.Email and how it is reshaping the world of email.