MFA from Microsoft

I need to develop the login in a test automation, where there is authentication in the second factor (oauth2) from Microsoft(Microsoft Authenticator).

I searched in several places, I didn’t find any documentation or examples about oauth2.

Kindly, has anyone ever needed to implement something similar? Any libraries to recommend?

Using storageState argument with Browser library’s New Context kw it is possible to bypass MFA.

You need to at first create a test script in which you manually do login to the target system and then save the storagestate, and then next test runs can use the saved storagestate file to bypass the MFA during login. Of course, this approach will work only until the MFA session expires, so then you have to recreate the storagestate file manually again.

Thank you for the informations.

I was able to develop using the Robotframework-OTP library.