How to Automate Microsoft Verification Codes for Two-Factor ID

Dear all,

The absolute bane of my life is Microsoft verification codes for two-factor ID.

I won’t bore you with all the details but I have two jobs. Each gives me a MS365 account. Each account has to be signed in on calendar, email, OneDrive etc. Across two Macs. And each requires signing back in regularly for security reasons. It drives me mad. I reckon I do it at least half a dozen times a week. Or at least it feels like it.

I’d really like to automate this.

The two-factor code arrives by text message which is forwarded to my Mac. So I’m wondering if there is a way for the code to be copied from the incoming text message and pasted to a KM clipboard which I can then just paste into the password box. Whilst that is the structure, I’m at a loss to know how to start.

Has anyone come across this? Can anyone point me in the right direction for a macro or further reading?

Thanks so much.

Messages is no longer scriptable, so you'll have to brute-force this...

Sorry… brute-force it how?

I don't have MS365, so I can't help you with that directly.

How would you do this by hand?

Look at the steps and then ask yourself how you would streamline the process with Keyboard Maestro.

Then start experimenting.

Any reason you can't use an authenticator app or a password manager like 1Password that has 2FA capabilities built in? It would both be much more secure than codes sent over SMS and considerably more easily automated.

1 Like