Title: &#8220;Invalid token format&#8221; Error and 500 Errors
Last modified: September 26, 2017

---

# “Invalid token format” Error and 500 Errors

 *  Resolved [Jacob Hill](https://wordpress.org/support/users/tekfused/)
 * (@tekfused)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/invalid-token-format-error-and-500-errors/)
 * Hello,
 * When I try to login (Even when I try to go the plugins page in wp-admin) I get
   a 500 error. I also got an error when I tried to go to my WP-Admin plugins page(
   Don’t remember the error). I tried to revoke and reauthenticate, and it did work
   for a time, but probably only a few days. It broke again, so I had to disable
   the plugin. I really want to use it, but I can’t because the error is confusing
   my users and causing other issues.
 * Here is my system info:
 * OS: Linux ip-###-##-##-## 4.4.0-1032-aws #41-Ubuntu SMP Mon Aug 14 13:08:44 UTC
   2017 x86_64
    PHP version: 7.0.22-0ubuntu0.16.04.1 WordPress version: 4.8.1 WordPress
   multisite: No openssl: Available allow_url_fopen: Enabled stream_socket_client:
   Available fsockopen: Available cURL: Available cURL Version: 7.47.0, OpenSSL/
   1.0.2g
 * Here is the error:
 * Notice: Undefined index: refresh_token in /var/www/html/———————/wp-content/plugins/
   gmail-smtp/main.php on line 681
 * Fatal error: Uncaught InvalidArgumentException: Invalid token format in /var/
   www/html/———————-/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/
   Client.php:434 Stack trace: #0 /var/www/html/———————-/wp-content/plugins/gmail-
   smtp/class.phpmaileroauthgoogle.php(138): Google_Client->setAccessToken(Array)#
   1 /var/www/html/———————-/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php(
   470): GmailXOAuth2->getOauth64() #2 /var/www/html/———————-/wp-content/plugins/
   gmail-smtp/class.phpmaileroauth.php(152): SMTP->authenticate(”, ”, ‘XOAUTH2’,”,”,
   Object(GmailXOAuth2)) #3 /var/www/html/———————-/wp-content/plugins/gmail-smtp/
   PHPMailer/class.phpmailer.php(1540): PHPMailerOAuth->smtpConnect(Array) #4 /var/
   www/html/———————-/wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php(
   1335): PHPMailer->smtpSend(‘Date: Fri, 15 S…’, ‘This email was …’) #5 /var/www/
   html/———————-/wp-content/plug in /var/www/html/———————-/wp-content/plugins/gmail-
   smtp/google-api-php-client/src/Google/Client.php on line 434

Viewing 1 replies (of 1 total)

 *  Plugin Author [Noor Alam](https://wordpress.org/support/users/naa986/)
 * (@naa986)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/invalid-token-format-error-and-500-errors/#post-9530125)
 * [https://wordpress.org/support/topic/refresh-token-bug-i-will-rate-you-5-stars-if-fixed/](https://wordpress.org/support/topic/refresh-token-bug-i-will-rate-you-5-stars-if-fixed/)
 * If you continue to have this issue you can downgrade to version 1.1.2 before 
   the Google API Client library got updated in the plugin:
 * [https://wordpress.org/plugins/gmail-smtp/advanced/](https://wordpress.org/plugins/gmail-smtp/advanced/)

Viewing 1 replies (of 1 total)

The topic ‘“Invalid token format” Error and 500 Errors’ is closed to new replies.

 * ![](https://ps.w.org/gmail-smtp/assets/icon-128x128.png?rev=2432932)
 * [Gmail SMTP](https://wordpress.org/plugins/gmail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gmail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gmail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/gmail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gmail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gmail-smtp/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Noor Alam](https://wordpress.org/support/users/naa986/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/invalid-token-format-error-and-500-errors/#post-9530125)
 * Status: resolved