Automating MFA using OKTA

Hi,
I am trying to automate MFA login process. I was looking into OKTA CLI and APIs but there is not a way to generate TOTP through them. Does anyone know how would I be able to automate MFA login ? If using libraries like Oathtool is the only option, how do I go about extracting secret key from Okta QR code ?

Note:
Using Robot framework, selenium to automate test.
Thank you!!

Hi @Ayesha,

You might try Direct Auth to initiate the TOTP factor using the API: Configure Direct Authentication grant types | Okta Developer