Gmail – How does Google’s new two-factor authentication work with IMAP, POP, etc.

authenticationgmailgoogle-apps-emailSecurity

I'm very excited about Google's new two-factor authentication. Two-factor authentication means, in this case, that instead of just authenticating based on "something you know" (your password) you also authenticate based on "something you have."

In this case, the "something you have" is your mobile phone. Once this is enabled, you give Google your mobile phone number. Then whenever you try to log on to your account, Google sends a SMS message to your mobile with a six-digit number you enter to prove that you are really you. (There's a "remember me for 30 days" checkbox to make this non-awful on your own computer, which is, after all, "something you have").

How does this interact with IMAP and POP3 clients? What about accessing Gmail through the API?

Best Answer

What you need to do is generate an application-specific password for each client you want to authenticate to your Google account. Then enter the application-specific password instead of your password or password + verification code.

You can generate these application-specific passwords by going to this page (use your domain name instead of example.com):

https://www.google.com/a/example.com/IssuedAuthSubTokens?hl=en&service=mail

Google provides instructions for doing this on their Sign in to mobile or desktop apps page.