Automate Two-Factor Authentication to login into Citrix


I have to automate login into Citrix VDI but it has two-factor authentication which has two options.
1.) Send OTP code in Mobile SMS
2) Get a call on mobile and click a particular number as per instruction

Please help me on this how can I automate this so I can make Unattended robot.

Please help me on this.

Hi @zoyebmansuri! Maybe you can give Mobile Automation a chance: Mobile Device Automation with UiPath Studio (20.4 Community Preview Release)

I don’t know how you could skip the 2-factor authentication but maybe with Mobile Automation you could get through it automatically

Two-Factor authentication is pretty hard, but might be doable. The issue is you need to get the code from the phone to the desktop. The only option I can think of is as follows:


  • login to citrix up to the point a code is sent to the mobile phone


  • connect the phone to the same desktop, and install a remote viewer app, like TeamViewer or some other.
  • add a delay to make sure the text message gets there
  • next steps could be done with ComputerVision or (I guess) Mobile automation
  • you’ll need to find a way to “open” the phone, like pressing the home button. I think the mobile remote app should have some way of triggering those hardware buttons.
  • using CV or Mobile automation unlock the phone by entering the PIN# (should be easier if the phone authentication is with a PIN than with the swipy thing android has)
  • go to text messages
  • go to the contact that sent the Citrix auth code
  • scrape the area of the screen that contains the message
  • do some string manipulation on it to get only the code


  • enter that code in Citrix

If you encounter difficulties, post here

Go through the below blog, That might help you automate OTP from Text messages:

1 Like