How to fix less secure app access problem in Gmail ...? - smtp

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 ...?

TLDR:
I had a similar problem, I set up an App Password, and my email-sending piece of code is working fine again.
This video shows how to set up App Password.
Google's formal instructions for setting up an App Password.
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.

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.

It can be done via 2 factor authentication and app password

Related

Google App script: Clasp login has stopped working

I've been using CLASP for the development of Google App Script. Clasp login command is no longer working after Clasp logout.
Steps
Execute Clasp login in VS Code Terminal. It redirects to the Google OAuth page.
Entered credentials and accepted the required permissions for Clasp in the browser
After successful authentication, it redirects to some localhost:port and then it gets stuck with this error
I've also tried using clasp login --no-localhost, but it gave different error:
The problem is that your browser is forcing https:// on your localhost. The way clasp login works is that it creates a temporary local server to receive the authorization code from Google in the OAuth flow. This server won't have an SSL certificate so forcing an https connection will return that error. Your potential solutions are:
Try to just change the start of the URL from https:// to http://, though if it's not working already it probably means that something is forcing it.
Create your own localhost cert. Though this is probably overkill, especially if you want it only to install Clasp.
Temporarily disable any browser extensions or settings that force SSL. Or try a different browser.
You seem to be on Edge, you can go to edge://net-internals/#hsts (or chrome://net-internals/#hsts on Chrome) then add localhost under "Delete domain security policies" and click "Delete".
If this is a corporate device check for any antivirus or policies that would force SSL everywhere and see if you can add localhost as an exception.
If you're completely restricted, you can authorize on another computer that doesn't force SSL on you and just copy the .clasprc.json file from the other %USERPROFILE% folder to your current one. The credentials will be associated with the Google account that you used to sign in.
As for why the -no--localhost flag doesn't work, this is because the Out-Of-Band flow has been deprecated. You can see this in the full description of the error:
This means that the "enter a code" flow is no longer supported and Google has blocked it. It's up to the devs to update the Clasp app to remove the flow or to implement a workaround. You can try to report it in their Github page. As far as I can tell there's not much that can be done about this setting and you most likely will need to go with the localhost method.

Keycloak SMTP configuration with Google Workspaces

I'm setting up the SMTP server on my keycloak instance.
I tried with my Gmail account, just to see if it works. I generated applications credentials following Google documentation. It worked nicely.
Now, I want to use the SMTP relay mode on my Google Workspace account, which has a specific domain. Google recommends. It works on other apps I have, but I could not make it work with Keycloak. There is no place to put the Domain so I don't even know if it's possible.
I searched the internet. This guy encountered my issue, but I think he solved it by doing it with applications credentials as I did in the beginning.
The thing is, I'd prefer not use application credentials because that would link my app to a Google User. I could create a dedicated one, but it would be a monthly cost. The SMTP relay solution seemed the perfect way, until I could not make it work.
Is there something I miss ? Maybe another way to use Google's SMTP server ?
Thank you for reading
Antoine

duck (CyberDuck CLI) with google drive

I'm trying to get the Cyberduck CLI (duck.sh) to work interfacing with a google drive (not "Google Cloud Storage") and I'm having problems getting the oAuth authorization to work. I found this thread but it's out of date - as the newer versions of Cyberduck do absolutely work with Google Drive. Using the regular cyberduck GUI I can browse and operate on my G-drive instance, but I can't quite quack the code (sorry!) for how to make this work using the CLI.
[lwobker:~]$ duck -l googledrive://<user>#gmail.com/
Authenticating as <user>…
OAuth2 Authentication. Paste the authentication code from your web browser.
Authentication Code: <pasted pass here>
Save password (y/n): n
Disconnecting www.googleapis.com…
Login failed. Malformed auth code. Please contact your web hosting service provider for assistance.
I've tried a number of different URLs, including:
#gmail.com
me#gmail.com#www.googleapis.com
and a couple of others.
I also can't seem to figure out where the GUI version of cyberduck stores it's authorized credentials... if I could re-use those that would be fine, doing a one-time setup at the beginning doesn't break my use case.
I'm somewhat familiar with the Google Developers API, and I've created one for use with this project, but I can't seem to figure out how the Google "Client ID" and other credentials map to the Cyberduck tool.
Make sure you paste the auth code obtained from the Google login page opened exactly as is without any line breaks. More information is available in the wiki.

Is there a way to connect with EWS without user credentials if I'm not using Office 365?

Original jamesiarmes/php-ews offers authentication only by username / password. Fork by Garethp has some OAuth function but it requires Office365 and registering application in Azure. Is there any possibility to connect to Outlook by web browser just relying on user logged to Windows System? I know how to read which user is logged using kerberos, but don't know if it's right tool to make it.
There's no way with either of those tools. I looked in to trying to use Network Authentication as method of Auth, since my fork uses NTLM any way, but I couldn't find any resources on passing the NTLM Authentication over SOAP calls. That being said, if you can find some examples, I'd be happy to build it in as a method of authentication for you
In the EWS service object, you can select the flag to use default credentials, meaning whatever user context the code is running under. Would that help?

SSRS 2014 I cannot open http://localhost/Reports due to permissions

I've looked at a number of potential solutions to the but nothing seems to work.
Basically, I have installed SQL Server 2014 on my own PC.
Everything works fine with the exception of SSRS
Initially, inputting the URL http://localhost/Reports returned a blank screen.
Then, after a bit of research and playing around, I made a little progress.
Now, despite me been an admin on my own machine!, it's comes back with:
User does not have required permissions. Verify that sufficient permissions have been granted and Windows UAC restrictions have been addressed.
As I say, there are a couple of 'potential' solutions but they require access to the URL - which I simply cannot get.
I feel this is a security related problem but have tried all sorts of potential solutions.
Open the browser with run as Administrator.
If you get any prompt for username and password. Change your intranet browser setting.
I've found the answer and it seems to be a combination of things.
Via Reporting Services Configuration Manager Add an additional HTTP identity for both the web Service URL and Report Manager URL.
Set Host Header Name to localhost
Set TCP Port to 8080
Note, I also found that 80 clashed with Skype causing a 'Page cannot be displayed' error
Although I have amended my Skype setting, I also amended the SSRS port
I'm not sure how crucial this is but it worked for me
Through Control Panel
Search for UAC, select Change User Account Control Settings
Amend to Never Notify
I am still uncomfortable with this but have found no other way of getting this to work.