DEV Community


Discussion on: Selenium Testing - How to sign in to Two-factor authentication?

tati19863 profile image

Hello Sakamoto,

I accessed the user configuration in mfa (Microsoft), clicked the button to configure the authenticator application and took the 12 digits of the user's secret key, converted it to base32 and added it to the code in the system, but it is generating a code that is not expected . I cannot identify what is wrong.
Can you help me?

smicius profile image

I don't know where did you get 12 digits secret key, but Microsoft MFA worked for me with 16 characters secret key. Maybe you provided the wrong value. I've got 16 characters MFA Microsoft secret key this way:
1) Go to MFA setup window by this Microsoft Documentation:
1.1) Sign in to
1.2) Select your account name in the top right, then select profile.
1.3) Select Additional security verification.
2) Click "Set up Authenticator app".
3) Click "Configure app without notifications".
You should see 16 characters secret key value (it contains spaces, but you need to remove them).