How to fix less secure app access problem in Gmail ...?
Asked Answered
L

4

11

Google is getting rid of less secure app access feature. I'm using smtp email service for my website's contact page. But after 30 May, 2022 this service will not work probably.

Is there any other way to give third party less secure app access to my Gmail account ..?

Can an app password solve this problem ..? I have doubts that setting app password will not give access either as google said this may not work for less secure app.

So is there any way to fix this so that the smtp email service works as it should ...?

Lading answered 5/4, 2022 at 17:32 Comment(2)
Have you checked xoauth2?Pond
I heard of it but didn't really get into it. I think this can solve my problem probably. But I don't know the mechanism so not totally sure. Do you think it will work without that less secure app access turned on in Gmail ...?Lading
E
9

TLDR:

Caveats:

  • Initially, Gmail had automatically turned off my less secure apps setting because I hadn't used that test account in several months. I turned it on, but since I saw the message that it'd be disabled by 2022.05.30, I went ahead and set the app password. This means my current setup has both less secure apps AND app password enabled in my Gmail account, though I'm only using the app password for authentication.
  • My program usually ran from within WSL2 on top of Windows 11. Even after setting up the app password, my code was returning a gaierror: [Errno -3] Temporary failure in name resolution error when running from within WSL2. I then tried running it straight from Windows 11 and it worked just fine. I now need to fix the networking issue causing this, but it doesn't seem to be directly caused by using app password.

I hope this helps.

Ere answered 3/5, 2022 at 12:6 Comment(4)
I understand how to setup an App password, but how do use it with smtp in a program - for example PHPMailer?Bodgie
@Chiwda, you might want to check this PHP-specific answer: #14457173Ere
that answer doesn't use App Password which is different from a simple password.Bodgie
@Bodgie Turn on 2 factor authentication, Generate APP Password and then in you code username is your account address and password is APP PASSWORD (not account password).Cecelia
A
3

Note: 2-factor authentication needed to be enabled before proceeding.

Less secure apps (https://myaccount.google.com/u/0/lesssecureapps) options is deprecated.

We can use apppasswords functionality provided by Google using following link.
https://myaccount.google.com/u/0/apppasswords

Use 16 digit code provided by google instead of password and that should serve as authentication token.

enter image description here

Atoll answered 18/1, 2023 at 15:23 Comment(0)
T
1

A while back, Gmail had automatically turned off my less secure apps setting.

I just fixed my PHP code.

It can be done via 2 factor authentication and 16 digit app password provided by google.

Tributary answered 11/1 at 11:33 Comment(0)
I
0

It can be done via 2 factor authentication and app password

Incognizant answered 2/5, 2022 at 2:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.