4. Setup ngrok. Ngrok creates a public url that will be linked to your localhost environment. For
security purposes, TypingDNA Verify 2FA will only run on a public url. Ngrok can be downloaded from the
following link: https://ngrok.com/
The first step is to configure the Okta demo to run with ngrok.
Log in to the Okta dashboard.
Under Applications select the custom application that was created as part of the demo. In this case, the
application is called TypingDNA Verify 2FA.
Edit the Sign-in redirect URIs and Sign-out redirect URIs with the ngrok link.
In the index.php file edit the $redirect_uri to contain the ngrok
link and client_idclient_secretmetadata_url with the values from
$client_id = 'Your_client_id';
$client_secret = 'Your_client_secret';
$redirect_uri = 'https://b286080dca95.ngrok.io';
$metadata_url = 'https://dev-53749351.okta.com/oauth2/default/.well-known/oauth-authorization-server'
// Fetch the authorization server metadata which contains a few URLs
// that we need later, such as the authorization and token endpoints
$metadata = http($metadata_url);
After the OAuth2 exchange flow, add the following code that will set the username in session and will redirect
the user to verify.php page:
Next we will add the verify.php file. First we include TypingDNAVerifyClient
library and then we initialize our variable just like we did in index.php. We also create an
TypingDNAVerifyClient instance using the credentials from Verify 2FA Dashboard and store it in $typingDNAVerifyClient
$typingDNAVerifyClient = new TypingDNAVerifyClient($client_id, $application_id, $secret);
Once we have a TypingDNAVerifyClient instance, we will generate the data attributes required to
start TypingDNA Verify 2FA.
For this demo we will use the email as the root of trust and we will populate this information from the
Share this message across Slack, email, etc. We even jotted down some of the highlights to make it easier.
Check this out! 🚀 Found a cool way to 2FA our users: TypingDNA Verify 2FA. It authenticates people based on how they type — replacing authenticator apps and OTP codes. Awesome user experience! 🙌 Quick integration too (under 10 mins). And we can try it free with 100 users. What do you think? https://www.typingdna.com/verify