# How to Automate Okta 2FA

**URL:** <https://devforum.okta.com/t/how-to-automate-okta-2fa/22247>\
**Category:** API\
**Created:** [October 25, 2022, 1:14pm UTC](https://devforum.okta.com/t/how-to-automate-okta-2fa/22247 "2022-10-25T13:14:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdhepe](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/rdhepe/32/4282_2.png) [@rdhepe](https://devforum.okta.com/u/rdhepe)\
**Post date:** [October 25, 2022, 1:14pm UTC](https://devforum.okta.com/t/how-to-automate-okta-2fa/22247/1 "2022-10-25T13:14:39Z")

</div>

As a QA, i need to automate the log in flow of my application.  
Steps as usual  
1.Log into the application  
2.Get the Okta code  
3.Enter the Okta code and authenticate the log in.

I am trying to do this with Python, I just need to know, based on my user id and password how i can get the authentication code via API or any other way, so i can enter that auth code in the UI of my automation script and proceed with testing.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 10:15pm UTC](https://devforum.okta.com/t/how-to-automate-okta-2fa/22247/2 "2024-02-12T22:15:03Z")

</div>


