What Is Causing This Error?
The ‘invalid_grant: AADSTS700082’ error often occurs on sites using Microsoft’s API to send emails. It indicates that the token you used to authenticate your Microsoft account has expired.
When configuring your site to send emails via Microsoft’s API, you’ll need to authorize your account. If you don’t send any emails from your site after authorizing your account, the token will become inactive and expire after 90 days.
When this happens, you’ll likely see the error message: invalid_grant: AADSTS700082: The refresh token has expired due to inactivity.
Resolving the Error – Solution
To fix this error, you’ll need to reauthorize your Microsoft account to generate a new authentication token. This can easily be done from the settings page in the SMTP plugin you use.
As an example, we’ll show you how to authenticate your Microsoft account with the WP Mail SMTP plugin.
For this, log in to your site’s admin dashboard and go to WP Mail SMTP » Settings. Then scroll to the Authorization section and click the Remove Connection button.
Next, click the Allow plugin to send emails using your Microsoft account button to authorize your Microsoft account.
After clicking on this button, you’ll need to select the Microsoft account you used to configure your site.
That’s it! Now you know how to fix the ‘invalid_grant: AADSTS700082’ error.
If you’d like to learn how to troubleshoot other common errors, check out the following docs: