Can't connect to Gmail SMTP secured with 2FA - gmail

For some reason, I cannot send an email from my application using Google SMTP protocol. I receive a message that looks like that:
1. Unhandled javax.mail.AuthenticationFailedException
534-5.7.14
<https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbt0
534-5.7.14
joZVenRyJq1oMRdChfymgOOgcAmikBwqT-_rFkNsHtvsquevNauUwW34Ksg5n8kXxPTALF
534-5.7.14
SYbdpH4O4GEE2TXaQmHScXAY15r_00D-lmyVzoJs54ba6RrOYb-yVcFNpsZbxxonQckTgd
534-5.7.14
dxdnp69p7t3_xj5523el2LWvh_HPE2lKTgOr8yLkeXjrFKYhvJT1jRhb5-Sy3Rs3G7OjuS
534-5.7.14 GdcriEyrrStn9Re4Vq7U46c5f8SwM> Please log in via your
web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more
at 534 5.7.14 https://support.google.com/mail/answer/78754
c12-v6sm1390727lji.59 - gsmtp
Some facts:
The web interface (gmail.com) works fine;
I've got 2FA enabled;
I use a new application password;
IMAP is enabled in gmail settings, I checked it;
Another account with 2FA and application password works fine in my app.
Both accounts are in different Google custom domains. May it affect them somehow?
Code (I use Clojure):
(def cred {:host "imap.gmail.com"
:user "user#my_domain.net"
:pass "application_password"
:ssl true})
(send-message cred {:from "test#test.com"
:to "bar#test.me"
:subject "hello"
:body "test"})
UPD: I also tried to follow the link from the response. It prompts me for 2FA and then redirects me to my account settings. Sending an email still doesn't work.

Not exactly sure which options the answer Ivan provided is referring to. They don't appear in my non-gapps account perhaps due to a UI update.
I had a similar problem with a nas cage configured to use a Gmail SMTP to send alert emails. Once I enabled 2FA on the Gmail account the emails would fail.
The solution was to create an 'App Password' under the google account security tab. Essentially these are passwords created on a per-app basis for programs/devices that do not support 2FA. Once you create the password, you use it in place of the original Gmail password for that specific app only. Here's a direct link to the Google Security App Password Page

After 8 hours of trying this and that I found an option in Google Apps. Go to Security -> Advanced -> Check "Allow users to manage their security settings" (it was disabled). Now it works, oh gosh.

Related

How to use nodemailer within new Google policy?

Well, it's quite simple actually... I'm trying to use nodemailer but everytime a try to call the mailer fucntion, it returns an auth error. I searched the error and apparently it's cause because of Google "less secure apps access" (https://myaccount.google.com/lesssecureapps) option, it has to be enabled, but the problem is: since may 30th of 2022, Google updated it's policy, and no longer has this option, so i can't use nodemailer in gmail anymore?
enter image description here
enter image description here
I tried to search the problem and find how to enable the "access to less secure apps" on Google gmail account configuration, but since Google updated it's policy, and they removed that option, i can't find any other solution. I didn't find anyone else with this problem either.
if you enabled 2fa on your google account you can create an apps password.
you can then use the apps password in place of your actual Gmail password in your Code
how to create an apps password

"Failed to authenticate user" exception in the c# Hello world sample of Docusign Signature Appliance demo

I have installed the trial version of DocuSign SA client for Windows desktop. Then I have checked out the docusign-signature-appliance-api-recipes repository and ran the C# Hello World demo in the dsa-local folder. The code from the demo is explained in the DocuSign Local API guide from which I have acquired the GitHub link in the first place.
As mentioned in the Quickstart section of the guide, I have created a Developer SandBox account. I have used the credentials of that account in the code, but the SAPI.Logon method fails at line 47 of Program.cs file.
I have also opened Docusign SA Prepare & Sign tool that was installed as part of the Docusign SA client and tried to sign a PDF. While doing so, I was prompted the credentials and I have entered the same credentials. But I got "Invalid username or password, operation canceled" error dialog.
I have also ensured that old credentials for DocuSign are not cached in my desktop. How can I make the user authentication succeed?
Sounds like something is wrong with your account details. Please contact our DSA Support by filling-in our web form, or by sending an email to: DSAsupport#docusign.com
Have you configured the DSA Client to point prime-dsa-devctr.docusign.net appliance?
You can also try to register again to https://go.docusign.com/signup/dsa-developer using the same credentials or new ones. Then make sure your credentials are correct by testing them at https://webapp-dsa-devctr.docusign.net/. Once correct use them in the SAPI.Logon method at line 47 of Program.cs file.

I can't login to LUIS Azure

I can't login to Luis via https://eu.luis.ai/home. Previously, when I logged in with a different personal account, I was able to login to Luis and to build my model(s). However, my organization just made a corporate account and I am not able to login with the newly created account.
I simply end up in a loop where I am requested to provide my username and password, then they forward me to the default Luis homepage and then I have to provide my username and password again if I click on the 'log in' button.
Different browsers didn't work. I am always able to continue on my personal account. Is it perhaps a security issue?
The issue is solved by connecting the specified (company) domain to Azure. This applies specifically if you work with different directories.
I solved the issue when I stumbled upon the following error code when inspecting the webpage source: "AADSTS65005: Using application 'Europe.Luis.ai' is currently not supported for your organization XXXXX.com because it is in an unmanaged state. An administrator needs to claim ownership of the company by DNS validation of XXXXX.com before the application Europe.Luis.ai can be provisioned".

Code Rally Login Not Working

For starters, I am on Ubuntu 14.04.
When I try to connect my username to the server and it asks for logging in with social network, I am unable to do so.
For "Login With Facebook", the page ends up going to facebook and a pop up displays saying:
App Not Setup: This app is still in development mode, and you don't
have access to it. Switch to a registered test user or ask an app
admin for permissions.
So, I guessed the facebook app wasn't set up properly and created a new user using Twitter. But logging in with Twitter fails as well. The OAuth goes through but when coming back to the app it says:
We were not able to match your social media account with this
username. Ensure your username is correct or the social media login
method is correct. Please close the browser and try again.
The link for "Or visit the Code Rally community for more details!" doesn't work either and I can't comment on any of the blog posts.
I am running out of social network logins so please advise what to do. Also, one thing to note is when I signup, I signup with a different email than the social network one, would that have anything to do with it?
which server are you trying to login on? (NA/EU/BR/IN/CN etc).
I'll go check the Facebook setup now to make sure I've not missed something, however it will help me narrow down the issue if I know which server is having issues.
The reason you can't login with Twitter on your ID is that it will already be associated with your Facebook ID which you registered with on InfoQ's contest site. To use Twitter you'll need to re-register a new ID on InfoQ's site and link it to your Twitter account (although I'd prefer to fix whatever is messing with the Facebook login).
edit
Looks like there was an issue in our Facebook OAuth config - it should be fixed now :-)

Email Messaging module is not working on azure

I have deployed Orchard on azure and enable Email Messaging module. Enabling says it enables successfully and asks for email settings. I provided it the mail server setting. Strange thing is, User setting does not show me the settings which are dependent on email messaging module (Contact us email address and public site name) and does not show me ("Lost your password") link . Also I have built a module which sends email. This module is not sending email.
Same orchard package works fine and also email on my dev server with same mail server settngs(gmail smtp settings.) But email is not working on azure.
What am i Missing ?
thanx
Just FYI for anyone else who visits this Question, I just got this working from Azure using the gmail SMTP server without any third party add-ons. I simply added the following SMTP details:
Then used the contact form to send an email to myself. The first email gives me an alert to my gmail account:
Hi Simon,
Someone recently tried to use an application to sign in to your Google Account - XXX#gmail.com.
We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt:
Monday, April 8, 2013 9:33:46 PM UTC
IP Address: 65.52.168.70
Location: United States
...blah blah blah
If this was you, and you are having trouble accessing your account, complete the troubleshooting steps listed at http://support.google.com/mail?p=client_login
Following the link give you the option to allow an application to login with your credentials. Just follow the link in step 3 and then you have 10 minutes to send another email from your orchard site. The next test message I received without issue.
Got it. Windows Azure itself does not allow sending email neither it allows to use SMTP. WE have to use third party email service like PostMark,SendGrid etc
http://blogs.msdn.com/b/publicsector/archive/2011/10/14/sending-and-receiving-email-in-windows-azure.aspx
So, I'm just curious how does WordPress, installed on Windows Azure (gallery), able to send emails?
http://coffee2code.com/wp-plugins/configure-smtp/
There are still too many different suggestions on the subject so i thought i should write what I've found useful. Here's what i did to get it to work:
My SMTP settings:
Sender address: myname#gmail.com
Hostname: smtp#gmail.com
Port: 587 (25 will also do)
SSL Communications: Checked
Credentials: My Gmail address and my password
These settings should work on your local environment just fine. But on the cloud you may need to do the following:
As your Azure VM may be at some arbitrary location, Gmail marks the login attempts as suspicious and blocks them. If this is the case, you should see a mail informing you about this suspicious activity in your inbox. Just follow the instructions there and mark the login as trusted. It will remain that way until somehow your IP on the cloud changes (e.g. deleting your deployment slot). VM relocation shouldn't be an issue since the IP still remains the same. You may have to do this separately for your staging and production slots.
Lastly, I enabled full trust for my web role as shown here:
http://blogs.msdn.com/b/windowsazure/archive/2009/03/18/hosting-roles-under-net-full-trust.aspx
I hope this helps others having this problem.
Cheers
No more third-party with GitLab 15.5 (October 2022):
Deliver emails using Microsoft Graph API with client credentials flow
If you’ve enabled security defaults in Azure AD,
legacy authentication protocols for SMTP are blocked.
You can now configure your GitLab instance to deliver emails using
Microsoft Graph API
with OAuth 2.0 client credentials flow.
See Epic, Documentation and Merge Request.
The gitlab.rb would include:
gitlab_rails['microsoft_graph_mailer_enabled'] = true
# The unique identifier for the user. To use Microsoft Graph on behalf of the user.
gitlab_rails['microsoft_graph_mailer_user_id'] = "YOUR_USER_ID"
# The directory tenant the application plans to operate against, in GUID or domain-name format.
gitlab_rails['microsoft_graph_mailer_tenant'] = "YOUR_TENANT_ID"
# The application ID that's assigned to your app. You can find this information in the portal where you registered your app.
gitlab_rails['microsoft_graph_mailer_client_id'] = "YOUR_CLIENT_ID"
# The client secret that you generated for your app in the app registration portal.
gitlab_rails['microsoft_graph_mailer_client_secret'] = "YOUR_CLIENT_SECRET_ID"
gitlab_rails['microsoft_graph_mailer_azure_ad_endpoint'] = "https://login.microsoftonline.com"
gitlab_rails['microsoft_graph_mailer_graph_endpoint'] = "https://graph.microsoft.com"

Resources