Step 1: Load the OTPLESS JS
To integrate the OTPLESS Sign-in into your website, insert the following script into thehead
section of your HTML code:
index.html
Replace
YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.Step 2: Create the OTPLESS Login UI
Insert the followingdiv
in your login or sign-up page where you want the OTPLESS login UI to appear:
login.html
Ensure your site is served over HTTPS to enable the sign-in widget to load
properly. For local development, consider using tools like
ngrok to create a secure tunnel.
Step 3: Configure Authentication and UI
Configure Auth Method
Choose from various authentication methods such as SMS, WhatsApp, Email, and
Google to optimize user access.
Configure UI
Customize your authentication interface to align with your brandβs identity
and enhance user experience.
Step 4: Handle Authentication Callback
Implement a callback function to process authentication responses. Add this script to your page:index.html
π Checkpoint
To ensure a smooth integration process:- Deploy your app/website with the included OTPLESS SDK.
- Conduct tests to verify the sign-in flow functions correctly.
- Ensure that after a successful sign-in, the user is redirected back to your app/website and their information is correctly logged in the console.
User Information Response Structure
The structure of the user information returned upon successful sign-in is as follows:You can check out a complete sample response
here.
Next Steps
Validate ID Token
Learn how to securely `validate ID token` returned by OTPLESS vue SDK to ensure the authenticity of sign-in events from your backend server.
Validate Token (Opaque)
Learn how to securely `validate token` returned by OTPLESS vue SDK to ensure the authenticity of sign-in events from your backend server.