Search code examples
iosgithubtwo-factor-authenticationauthenticator

Re-enable GitHub two-factor authentication with Authenticator app when switching to a new smartphone


I changed my iPhone recently. Now, when I log in to GitHub, it asks me to enter the code from my Authenticator app.

But the old GitHub entry is gone in the Authenticator app on the new phone! Apparently, it was not transferred with the rest of the data from the old to the new iPhone.

How can I re-enable GitHub two-factor authentication with the Authenticator app on my new smartphone?

Note:

The Authenticator app is the Microsoft Authenticator app for iPhone

MS Authenticator


Solution

    • In the upper-right corner of any GitHub page, click your profile photo, then click "Settings" ("gear" icon).

    settings

    • In the "Access" section of the sidebar, click "Password and authentication".

    password

    • In the "Two-factor authentication" section of the page, under "two-factor authentication":
    • Under "Authenticator app", click on "Manage Authenticator app" (... icon), click on "Disable". The page will refresh.

    authenticator

    • Under "Authenticator app", click "Add". This will display the QR code image on the page.
    • Open in the smartphone the Authenticator app. Click on the + icon to add an account.

    Authenticator app: + to add an account

    • Click on "Other". Scan with the phone camera the QR code on the GitHub web page above.

    QR code

    • After scanning, the Authenticator app displays a six-digit code that you can enter on GitHub.
    • The Authenticator app saves your account on GitHub.com and generates a new authentication code every few seconds. On GitHub, type the code into the field under "Verify the code from the app". Click "Save".

    References:

    Configuring two-factor authentication - GitHub Docs - how to set up two-factor authentication from scratch (before Authenticator was used for the first time).