When I try to authenticate with Chilkat IMAP, I get this failure:
ImapCmdResp: aaab NO [ALERT] Please log in via your web browser: http://support.google.com/mail/accounts/bin/answer.py?answer=78754 (Failure)
asked Feb 16 '15 at 09:07
Double-check your application to make sure the correct login/password is being passed to Chilkat.Imap.Login
Assuming it is correct, then the likely resolution is to configure your GMail account to "allow less secure apps": https://support.google.com/accounts/answer/6010255
In GMail terms, "less secure" means logging in with a login/password via SSL/TLS.
More secure means to use an OAuth2 access token, which can be done using Chilkat as shown in the examples:
answered Feb 16 '15 at 09:11
Here is my situation.
Initially gmail authentication through Chilkat failed and after analysing I found that I have to turn ON "allow less secure apps". Then the authentication succeeded. To avoid turning ON "allow less secure apps" in every gmail account, I followed solution provided in below link.
1) We created a certificate file(.p12).
Through the service account(in developer console) and we have the service account email address as well.
2) I am able to generate accesstoken successfully.
NSString *accessToken = [http G_SvcOauthAccessToken: iss scope: scope subEmail: sub numSec: [NSNumber numberWithInt: numSec] cert: cert];
3) Connecting to "imap.gmail.com mail" server succeeded.
success = [imap Connect: @"imap.gmail.com"];
4) But when I try to authenticate to gmail account using any gmail ID the authentication fails.
success = [imap Login: @"email@example.com" password: accessToken];
Below is the error message I get in imap.LastErrorText.