A simple 4-step process will allow users to log in to Gmail from a third-party app. We have provided the complete step guide here: -
1 ) Open a Web Browser and login to your Gmail account
2 ) Hit on the "Gear" icon from the upper-right corner of your screen.

3 ) click on "See All Settings" from quick setting dropdown window.

4 ) Hit on Forwarding and POP/IMAP tab.

5 ) From IMAP Access section, select the Enable IMAP radio button and click on Save Changes.

1 ) Open your Web browser and login to your Gmail account.
2 ) Click on your profile and press "Manage your Google Account" button.

3 ) Click on Security tab from the right sidebar and Select 2-Step Verification.

4 ) From the next screen, click on Get Started >> Try Now button.

5 ) Enter your Phone Number and choose the option Text Message or Phone Call and hit on Next.

6 ) Add the confirmation code (Recieved from Google) and click on Next.

7 ) Lastly, click on the Turn On button to add 2 step verifcation on your Gmail account.

1 ) Open Gmail account settings (Manage Your Gmail Account).
2 )Clickon Security tab, then Search or Scroll to "App Passwords" section and select it.

3 ) Under the "Select app" dropdown, choose Other (Custom name).

4 ) Enter a name of the app for which you creating app password (e.g., Regzion Gmail Backup and Migration tool) and press the Generate button.

5 ) A new screen will appear on your computer with your new Google App Password for third-party app login.

6 ) Now copy this key and use it for login to Gmail account in your third party app.
Step 1:- Open the third-party application where you want to log in.
Step 2:- When prompted for your Gmail password, enter the app-specific password you just generated.
Step 3:- Complete the setup in the third-party app and begin using it to back up or migrate your emails.