<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Khor</title>
    <description>The latest articles on DEV Community by Khor (@neth_6).</description>
    <link>https://dev.to/neth_6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F108712%2F881f6232-74b8-423e-acdc-367a42d1f056.jpg</url>
      <title>DEV Community: Khor</title>
      <link>https://dev.to/neth_6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/neth_6"/>
    <language>en</language>
    <item>
      <title>Free Phone SMS Verification on Your Website in 10 minutes</title>
      <dc:creator>Khor</dc:creator>
      <pubDate>Thu, 11 Jul 2019 05:22:53 +0000</pubDate>
      <link>https://dev.to/neth_6/free-phone-sms-verification-on-your-website-in-10-minutes-1558</link>
      <guid>https://dev.to/neth_6/free-phone-sms-verification-on-your-website-in-10-minutes-1558</guid>
      <description>&lt;h1&gt;
  
  
  Phone SMS Verification Overview
&lt;/h1&gt;

&lt;p&gt;Phone SMS verification is useful for 2 purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It reduces fake signups by verifying a user phone number, instead of just email, which can be easily replicated, during signup
&lt;/li&gt;
&lt;li&gt;It ensures that the user who signs up can be communicated with in a timely manner by voice or SMS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These two features are critical for building businesses that are founded on a trustworthy user base, and timely communication, in particular e-commerce, online reservation, fintech (micro-financing, cryptocurrency), and sharing economy.&lt;/p&gt;

&lt;h1&gt;
  
  
  How does Phone SMS Verification Work?
&lt;/h1&gt;

&lt;p&gt;We send a one-time password (OTP) to a phone so that only the user with access to the phone can recall the OTP and input it on the website to prove that she owns the phone.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to send SMS OTP for free?
&lt;/h1&gt;

&lt;p&gt;SMS has to be transmitted through phone infrastructure, thus they incur charges, but some companies, Ringcaptcha, and Firebase, offers it for free with some minor restrictions. If you don't mind paying right off the bat, you can also check out Twilio, MessageBird, Cequens, Infobip, and Nexmo.&lt;/p&gt;

&lt;p&gt;Among the free options, Firebase only works if you its SDK that is tightly integrated with the Firebase programming framework, while Ringcaptcha offers an API so it works with any programming language and framework that you are using.&lt;/p&gt;

&lt;p&gt;Ringcaptcha is also unique because it is an &lt;a href="https://ringcaptcha.com/reliable-secure-sms-voice-otp-marketplace?utm_source=dev-to&amp;amp;utm_medium=article&amp;amp;utm_campaign=sms-verification-in-10-mins" rel="noopener noreferrer"&gt;SMS marketplace&lt;/a&gt; so they can send SMS through all other providers like Twilio, MessageBird, etc., making it more highly available and reliable, as it has a lot of routes to fallback on when sending SMS. &lt;/p&gt;

&lt;p&gt;Ringcaptcha, it will be. &lt;/p&gt;

&lt;h1&gt;
  
  
  Outline of SMS Verification Implementation
&lt;/h1&gt;

&lt;p&gt;To get SMS verification on your website:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Signup for Ringcaptcha&lt;/li&gt;
&lt;li&gt;Create Ringcaptcha app&lt;/li&gt;
&lt;li&gt;Get Ringcaptcha app and API keys&lt;/li&gt;
&lt;li&gt;Test Ringcaptcha app and API keys&lt;/li&gt;
&lt;li&gt;Copy-and-paste code onto your website&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Signup for Ringcaptcha
&lt;/h2&gt;

&lt;p&gt;Head over to &lt;a href="https://my.ringcaptcha.com/register?utm_source=dev-to&amp;amp;utm_medium=article&amp;amp;utm_campaign=sms-verification-in-10-mins" rel="noopener noreferrer"&gt;https://my.ringcaptcha.com/register&lt;/a&gt; to create a user account. No credit card is required.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fz3t08ecpgcza663o6av3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fz3t08ecpgcza663o6av3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Ringcaptcha App
&lt;/h2&gt;

&lt;p&gt;Once logged in, click on the 'My Apps' on the left menu, and the click on 'Create New' button on the top right in the 'My Apps' page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd02042jn7mwhtddbx7rr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd02042jn7mwhtddbx7rr.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the app configuration window:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under 'App Type' select 'Web'&lt;/li&gt;
&lt;li&gt;Under 'Domain' enter the domain where you will paste the Ringcaptcha Javascript widget code later&lt;/li&gt;
&lt;li&gt;Still under 'Domain', enter 'fiddle.jshell.net', which is the live coding site where you will test your API and App key. Delete this after testing.&lt;/li&gt;
&lt;li&gt;Hit 'Create App' at the bottom right of the window.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Floz3omn9aji8qi725cho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Floz3omn9aji8qi725cho.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Ringcaptcha app and API keys
&lt;/h2&gt;

&lt;p&gt;You will see your newly created app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3kbspetx2gpt368z3rqn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3kbspetx2gpt368z3rqn.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get the API key on the top of the list of apps. The API key is the same for all apps.&lt;/p&gt;

&lt;p&gt;Get the App Key, which is on the right of each app. You can create a different Ringcaptcha app to represent each website that needs SMS verification.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Ringcaptcha app and API keys
&lt;/h2&gt;

&lt;p&gt;Head over the live code site where you can tweak, and test phone SMS verification without any coding: (&lt;a href="https://jsfiddle.net/ringcaptcha/e7uf8vdw/2/" rel="noopener noreferrer"&gt;https://jsfiddle.net/ringcaptcha/e7uf8vdw/2/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;This consists of 4 sections:&lt;/p&gt;

&lt;p&gt;Top left: HTML&lt;br&gt;
Top right: CSS&lt;br&gt;
Bottom left: Javascript&lt;br&gt;
Bottom right: Outcome&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8h95f2y9tvv44pcrdn29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8h95f2y9tvv44pcrdn29.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the 'Outcome', you should see the Ringcaptcha widget&lt;/p&gt;

&lt;p&gt;You can modify any of the HTML, CSS, Javascript sections, and click 'Run' on the top left to make your modifications take effect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before you do anything&lt;/strong&gt;, test your phone number on the widget to verify that it works.&lt;/p&gt;

&lt;p&gt;Try changing look-and-feel by modifying the CSS section. Change background-color of the button to 'blue' and hit 'Run'&lt;/p&gt;

&lt;p&gt;Similarly try changing the HTML data-locale to 'de' and hit 'Run' to see the widget language changed to German.&lt;/p&gt;

&lt;p&gt;Finally, under the Javascript section, you can modify it to perform different things based on the widget life-cycle 'events' such as 'ready', 'verified', etc. For a complete list of widget life-cycle 'events', see &lt;a href="https://my.ringcaptcha.com/docs/web#!#customizing-the-html-and-js-widget?utm_source=dev-to&amp;amp;utm_medium=article&amp;amp;utm_campaign=sms-verification-in-10-mins" rel="noopener noreferrer"&gt;this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, replace the 'appKey' the Javascript section, with your own App Key, and test the widget to confirm that it is working.&lt;/p&gt;

&lt;h2&gt;
  
  
  Copy-and-paste code onto your website
&lt;/h2&gt;

&lt;p&gt;All that is left to do is to copy the code snippets in the HTML, CSS, and Javascript on to your webpage and you will have implemented phone verification.&lt;/p&gt;

&lt;p&gt;If this doesn't work for you, please leave a comment, or you can also head over to Ringcaptcha and ask them in the live chat at the bottom right.&lt;/p&gt;

</description>
      <category>smsverificationservice</category>
      <category>2fa</category>
      <category>phoneverification</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Live Code Snippets To Instantly Test Any API Endpoints of Any OAuth/OAuth2 Providers</title>
      <dc:creator>Khor</dc:creator>
      <pubDate>Fri, 19 Oct 2018 07:48:06 +0000</pubDate>
      <link>https://dev.to/neth_6/live-code-snippets-to-instantly-test-any-api-endpoints-of-any-oauthoauth2-providers-11n0</link>
      <guid>https://dev.to/neth_6/live-code-snippets-to-instantly-test-any-api-endpoints-of-any-oauthoauth2-providers-11n0</guid>
      <description>&lt;p&gt;We have all been there where we pore over poorly documented OAuth API endpoints, some of which are already deprecated or even discontinued, before finding one that we believe can return some data that we want about a user, or can perform something on behalf of the user. Before we can test that endpoint, we spent more countless hours hacking together a social login button on our front-end code, which will communicate with the back-end, to complete the OAuth flow to acquire access token from the OAuth provider, e.g., Facebook, Twitter, Github, etc., and then finally, the moment of truth - calling the API endpoint with the access token.&lt;/p&gt;

&lt;p&gt;And &lt;em&gt;THEN&lt;/em&gt; - the endpoint does not do what we expected because its behavior has changed or the documentation is inaccurate.&lt;/p&gt;

&lt;p&gt;No developer should &lt;strong&gt;EVER&lt;/strong&gt; have to go through this! Thus we cobbled together a site with all the ready-made OAuth snippets to create a social login bootstrap button for every single popular provider, but that's not all, the site includes a snippet for calling every popular API endpoint of those providers.&lt;/p&gt;

&lt;p&gt;Sounds unbelievable? Let's spin the wheel to pick a random action to perform on an OAuth provider.&lt;/p&gt;

&lt;p&gt;Here we go.......... . .  .   .   .   .'Search for repository in Github'&lt;/p&gt;

&lt;p&gt;You can head over &lt;a href="https://tome.oauth.io/providers/github/search-a-repository?utm_source=dev-to&amp;amp;utm_medium=post&amp;amp;utm_campaign=oauth-pain"&gt;here&lt;/a&gt; to test the Javascript snippet to 'search for repository in Github' instantly, and also tweak it to call other Github API endpoints.&lt;/p&gt;

&lt;p&gt;If you want to jump the gun, and test other OAuth providers, head over &lt;a href="https://tome.oauth.io?utm_source=dev-to&amp;amp;utm_medium=post&amp;amp;utm_campaign=oauth-pain"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is a brief description of the working code.&lt;/p&gt;

&lt;p&gt;Firstly, the code is short, i.e., &amp;lt; 15 lines, all front-end Javascript, with no backend. Secondly, it has few external requirements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$('#github-button').on('click', function() {
  // Initialize with your OAuth.io app public key
  OAuth.initialize('txp2rKYpuKZXaaYC5kB-m13KnVE');

  // Use popup for oauth
  // Alternative is redirect
  OAuth.popup('github').then(provider =&amp;gt; {

    // Got the OAuth provider object, which contains access token, etc.
    console.log('provider:', provider);

    provider.get('/search/repositories?q=oauth-io').then(data =&amp;gt;            {
      console.log('Repositories:', data);
    });
  });
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Necessary requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CSS for creating the social button

&lt;ul&gt;
&lt;li&gt;bootstrap - &lt;a href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"&gt;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;bootstrap-social - &lt;a href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.12.0/bootstrap-social.min.css"&gt;https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.12.0/bootstrap-social.min.css&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;font-awesome - &lt;a href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"&gt;https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;DOM manipulation

&lt;ul&gt;
&lt;li&gt;jQUery - &lt;a href="https://code.jquery.com/jquery-3.2.1.min.js"&gt;https://code.jquery.com/jquery-3.2.1.min.js&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;OAuth magic by OAuth.io

&lt;ul&gt;
&lt;li&gt;OAuth.io Javascript library - &lt;a href="https://cdn.rawgit.com/oauth-io/oauth-js/c5af4519/dist/oauth.js"&gt;https://cdn.rawgit.com/oauth-io/oauth-js/c5af4519/dist/oauth.js&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to use the Javascript snippet on your own webpage, you can just copy-and-paste it but note that you need &lt;a href="https://oauth.io"&gt;https://oauth.io&lt;/a&gt; to make it work. If you are interested in the entire setup, I can do a separate post.&lt;/p&gt;

</description>
      <category>oauth</category>
      <category>oauth2</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
