Use Multi-factor Authentication from the Command Line

Use Multi-factor Authentication from the Command Line

This post demonstrates primary authentication, multi-factor enrollment and multi-factor enforcement with Okta - all from the command line.

Jack Halford

Please provide a link to the complete bash script?


The repo with the script can be found here:…

Prakriti Dave

If account is already added to the Okta Verify app, I guess we don’t need to do this step Back in the shell script, hit enter once you see the “Successfully enrolled in push authentication” message in Okta Verify.

In the steps mentioned above the only manual effort required would be to click on Approve for the MFA Okta notification on my phone? I wish to automate the the MFA Okta authentication process as much as possible.


Hi Micah, Do you have an script through which we can create MFA Add Sign on Rule? i mean right now i have to create manually for each app. thanks.