saran-surya / email_auth

A Flutter package to verify emails using OTP
https://pub.dev/packages/email_auth
MIT License
37 stars 14 forks source link

Failed to send OTP ❌ #87

Closed NutsNet closed 1 year ago

NutsNet commented 1 year ago

Hey Saran, this is what I'm getting when sending the OTP:

flutter traces:

flutter: email-auth >> Initialising Email-Auth server flutter: email-auth >> The remote server configurations are valid flutter: email-auth >> Failed to send OTP ❌ flutter: email-auth >> Message from server :: (535, b'5.7.3 Authentication unsuccessful [MN2PR15CA0010.namprd15.prod.outlook.com 2023-03-29T20:46:30.830Z 08DB2FFAF54322CA]') PYTHON SERVER :: Server error -> Mailing section

Heroku traces:

2023-03-29T20:55:13.512836+00:00 heroku[router]: at=info method=GET path="/test/dart" host=appname.herokuapp.com request_id=1259a943-2a3e-4865-a5af-b564cfc6cb0d fwd="66.215.96.73" dyno=web.1 connect=0ms service=2ms status=200 bytes=817 protocol=https 2023-03-29T20:55:47.058003+00:00 app[web.1]: -------- Server Key Verification --------- 2023-03-29T20:55:47.058161+00:00 app[web.1]: true 2023-03-29T20:55:47.058191+00:00 app[web.1]: ------------------------------------------ 2023-03-29T20:55:52.218106+00:00 heroku[router]: at=info method=GET path="/dart/auth/email@gmail.com?CompanyName=Company&key=XXXXXX&otpLength=5" host=appname.herokuapp.com request_id=4d1a2eaa-e1a5-446e-af7d-fa0436e56442 fwd="66.215.96.73" dyno=web.1 connect=0ms service=5157ms status=200 bytes=1090 protocol=https 2023-03-29T20:55:52.212360+00:00 app[web.1]: (535, b'5.7.3 Authentication unsuccessful [BL0PR1501CA0025.namprd15.prod.outlook.com 2023-03-29T20:55:52.213Z 08DB3059E6F5A5BE]') 2023-03-29T20:55:52.212374+00:00 app[web.1]: PYTHON SERVER :: Server error -> Mailing section

I checked my mailID & password parameters in config.env and they are correct.

Any idea on what could cause this issue?

saran-surya commented 1 year ago

Actually the error clearly states the outlook is not accepting the credentials, this is not related to the package, rather a problem with outlook authentication, can you kindly check and verify again if you are able to login to the browser manually, and if you have a two-factor authentication enabled..

NutsNet commented 1 year ago

I do not get why outlook credentials since the email I created is on gmail. I am able to sign in to my browser manually and tow-factor auth is disabled. Also in your documentation you ask to turn on less secure app, which is not possible since last year, could it be a problem?

Screenshot 2023-03-30 at 2 31 48 PM
saran-surya commented 1 year ago

Yes so this is the issue clearly, Kindly read the latest documentation in both the repositories, Sorry for not updating the GH pages.

https://github.com/saran-surya/email_auth#test-servers-obsolete--httpsgithubcomsaran-suryaemail_authdiscussions74discussioncomment-4270459

This can give you a good lead, you should only proceed with outlook as of now, As google has stopped the process of less-secure-apps, And we are requested to use the GMAIL api. Version 2 of the node plugin and the flutter package is currently in progress, so in case you wish to only use google in future, Kindly expect the latest release within 2 months, Sorry for the delay.

NutsNet commented 1 year ago

Make sense! Thanks a lot for your fast updates and explanation...

NutsNet commented 1 year ago

so in case you wish to only use google in future, Kindly expect the latest release within 2 months

Hi Saran, just checking if we can now use it with google?

saran-surya commented 1 year ago

so in case you wish to only use google in future, Kindly expect the latest release within 2 months

Hi Saran, just checking if we can now use it with google?

Actually no, Google has disabled the third party auth, So we cannot use them,..

NutsNet commented 1 year ago

Ok, I was able to make it work with an outlook account. Thanks...