Yarado and SMS Multifactor Authentication

When running fully unattended tasks in Yarado, you can sometimes run into the requirement to enter a multifactor authentication code that gets texted to a mobile phone number. In this post, we’ll offer some tips and tricks on how to deal with that.

Like all your other employees, robot Yara needs a phone number to receive MFA text messages. In our case, we use Twilio to set up a digital phone number for our robot employee. The examples in this post are therefore based on Twilio’s API, but this could also work with other services like Messagebird or Vonage.

Step 1

Create a Twilio account, get yourself a phone number and copy your Account SID and Auth Token from your account’s dashboard, as we’ll be needing those later.

Step 2

Send a text message to your new phone number, preferably a test containing a number.

Step 3

Download and unzip the Yarado task. This task contains a PowerShell script that fires an API call to Twilio to receive the last incoming text message to your phone number.
Twilio-SMS-TFA-Community.zip (2.4 KB)

Step 4

Complete the task template by entering your credentials into the variable:

  • Enter your Account SID as the variable value of %account-id%.
  • Enter your Auth Token as the variable value of %token%.
  • Enter your phone number as the variable value of %my-phone-number%. Please use E.164 formatting, for example, +319712345678.

Step 5

Send and SMS to your phone number, hit start and you should see the message’s code in as variable value of the %code% once Yarado has finished running.

Good luck and have fun!

PS. in case you want to use the example task as a subtask in your task, don’t forget to mark the %code% variable as global by adding gl_ in front of the variable name. See the variables section in the table here for more details.


@Menno Can you share a video of the running task?

@GJvanWieren, sure! You can check it out here.