laravel-gmail icon indicating copy to clipboard operation
laravel-gmail copied to clipboard

Authentication required issue

Open andrewtweber opened this issue 4 years ago • 1 comments

May not be the appropriate forum for this, feel free to close and I will move to StackOverflow. Tough to find answers there though as most are dealing with Laravel's built-in mail functionality

For one of my projects, every few days I will get this error:

Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required

Oddly, just clearing the config cache (and restarting supervisor, then retrying the failed jobs) seems to fix it. What I can't figure out is why, for my other projects, this never happens, it's only this 1 project.

  • As far as I can tell, the OAuth setup within Google developer console is exactly the same. They are internal projects, with the "Gmail API" scope (full read, write, and delete permissions).
  • The only slight difference between the projects is that this one is on a subdomain, all of the working ones are on the top level domain. But Google makes you add the top level domain as the authorized domain anyways
  • The storage/app/gmail/tokens folder and files have the same permissions
  • The .env files are exactly the same (with different credentials of course)

I left the project ID blank and set false for the two booleans. When I had the project ID filled in it seemed to fail even more frequently, daily. The working projects are functioning with the project ID blank.

GOOGLE_PROJECT_ID=
GOOGLE_CLIENT_ID="asdf"
GOOGLE_CLIENT_SECRET="asdf"
GOOGLE_REDIRECT_URI="${APP_URL}/oauth/gmail/callback"
GOOGLE_ALLOW_MULTIPLE_CREDENTIALS=false
GOOGLE_ALLOW_JSON_ENCRYPT=false

Is there any common issue you may have seen that I am missing that would cause this? Would appreciate any help

andrewtweber avatar Jul 15 '21 15:07 andrewtweber

I've never gotten this message before. If you can tell me more about which file is throwing this error I can try to help you.

dacastro4 avatar Aug 09 '21 14:08 dacastro4