Two-way Strong ¦ Sign In ¦ New User

Application Programming Interface (API)

 

Introduction

User Account

API Key

Test Environment

Web Application

Login

Token

Session Check

Session Check (Static)

Logout

Logout (Static)

Mobile Application

Mobile Login Check

Key Data Fields

Response Messages

Demo Examples

Powered By (Credit)

Technical Support

 

Login Function

The software developer implements the login function as a new Web page in their Web application. The following steps show you how to implement the login function.

Step 1: Include the following stylesheet link in the header of the HTML page. This stylesheet will disallow the user from selecting text on your Web page.

<link rel="stylesheet" href="https://www.2waystrong.com/assets/css/TwowayBrowserControlV01.css" type="text/css" />

Step 2: Include the following JavaScript function in the header of the HTML page. This function will disable the user from viewing your source code.

<script>
        window.oncontextmenu = function () {
            return false;
        };
</script>

Step 3: Create a new form. The URL in the action attribute connects to the Two-way Strong user login function.

<form method="post" action="https://www.2waystrong.com/ApiUsr/LoginV01Live"></form>

Use this URL address to connect to the Test Environment:

https://www.2waystrong.com/ApiUsr/LoginV01Test

Use this URL address to connect to the Live Environment:

https://www.2waystrong.com/ApiUsr/LoginV01Live

Step 4: Add a form label and a form input text field to collect the user's user name.

<p>User Name</p>
<input type="text" name="userID" value="" size="30" maxlength="15" title="User Name" placeholder="" tabindex="1" required />

Step 5: Add a form label and a form input radio button set to collect the user's choice to send a one-time passcode.

<p>Send a one-time passcode to your</p>
<p><input type="radio" name="modeID" value="PHN" tabindex="2" required /> Phone <input type="radio" name="modeID" value="EML" tabindex="2" required /> E-mail</p>

Step 6: Add a form submit button to allow the user to submit the form data.

<input type="submit" name="submit" value="SUBMIT" tabindex="3" />

Step 7: Add a form reset button to allow the user to clear the form input fields.

<input type="reset" value="CLEAR" tabindex="4" />

Step 8: Add a form input hidden field to store a value for the length of the client token. The value will tell Two-way Strong how long the one-time passcode should be. Possible values are 5, 6, 7, or 8.

<input type="hidden" name="tokenLen" value="5" />

Step 9: Add a form input hidden field to store your API key. Replace INSERT API KEY with your API key.

<input type="hidden" name="apiKey" value="INSERT API KEY" />

Step 10: Add a form input hidden field to store the absolute URL of your user login page. On failure, Two-way Strong will return the user to this page that you specify.

<input type="hidden" name="returnLoginPath" value="INSERT USER LOGIN URL" />

Step 11: Add a form input hidden field to store the absolute URL of your token page. On success, Two-way Strong will return the user to this page that you specify.

<input type="hidden" name="returnTokenPath" value="INSERT TOKEN URL" />

Step 12: Include helpful instruction about using the form. The following text is recommended.

<p>Submit your user name to receive a one-time passcode. The passcode is sent to your current phone number or e-mail address.</p>

Download the complete source code.