• Resolved christopherdisch

    (@christopherdisch)


    I am experiencing the following error about once a week on my client’s site. I set everything up as directed, but this continues to happen to cause form failures. I use Elementor Forms on the site and use WP Mail SMTP. I follow the instructions to re-connect, and everything works ok for another week, and then I receive this message again. Here are some details. The client does not use Google Workspace for their email, just a personal Gmail. I set up the API using their email account. I am hoping there is a simple solution to this issue.

    Mailer: Gmail
    {
    "error": "invalid_grant",
    "error_description": "Token has been expired or revoked."
    }
    Please re-grant Google app permissions!
    Go to WP Mail SMTP plugin settings page. Click the “Remove Connection” button.
    Then click the “Allow plugin to send emails using your Google account” button and re-enable access.

    Thanks,
    Chris

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @christopherdisch, @bst7,

    Thanks for reaching out. Generally, the error means that there are permission issues due to the Secret Key (and all tokens that were generated using that key) being invalidated. The issue can happen due to various reasons and can be resolved by re-connecting the account or regenerating the keys. Unfortunately, we aren’t sure why this is happening every week without anything being changed within your account. We’re monitoring this issue and get back to you as soon as we have some updates.

    Regards,

    Thread Starter christopherdisch

    (@christopherdisch)

    Please let me know if you would like any additional information on the issue.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi everyone,

    it looks like this is happening to more and more users, but we don’t know what the reason behind this account disconnect is. We have a lot of testing sites set up, and we never experienced this issue. I just rechecked my testing sites.

    One of the main things that could cause this issue is if your Google/Gmail API app is in “Testing” mode. Could you please check if the google API project is in the “Production” mode by going to the Google API console, opening the project for our plugin integration, then go to “OAuth Consent Screen” and check the “Publishing status”. More info can be found in this screenshot. It should say “In production”.

    If that’s not the reason, then we have to go over all the Gmail API project options together and see what the differences are. I think it has to be something on Google’s side since they are the ones that invalidate the token, not us.

    And to answer bst7’s questions:
    The Google API app is created by you, to be used just by you, even though on the free Gmail accounts you have the app set to “External use” (no other option is available), but nobody else will use this app apart from you, since you are the only one that knows the project credentials and have logged into it from your secured WP admin dashboard.

    Our plugin requires top-level permission because that’s the best way to future-proof our plugin development. If we were to improve our plugin and would have required only the minimal permission level, upon the plugin update, your connection would be invalidated and the newly added plugin functionality would not work. For example, we added the support for aliases a few versions ago and if we didn’t have the top-level permission, after the update all users would have to reset the connection manually in order for the Gmail mailer to work properly again. It’s just a way to make sure we can keep improving our plugin without any issues for our users.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Token has been expired or revoked’ is closed to new replies.