Why am I getting a JWT with a bunch of periods/dots back from Google OAuth?

Viewed 2118

In a web application I'm running, I suddenly started getting these odd tokens containing a huge string of periods at the end.

This happens even when I bypass my application code and call the function from the Google OAuth library directly.

Here's an example token:

ya29.c.Kp8BCgi0lxWtUt-_[Normal JWT stuff, redacted for security]yVvGk...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Could this be an upstream issue with Google OAuth? Has anyone else seen tokens like this?

4 Answers

Same here, it suddenly started. Had to remove them from the received token, now it works again.

I found the problem is on the Google server-side. It's actually returning the JWT with the trailing "." chars. I'm updating Chilkat to automatically trim the trailing "." chars if found before returning the JWT.

Same with me. And it leads to Error: Invalid login: 555 5.5.2 Syntax error for my nodeMailer application.

Solved with the following code:

tokensCache.access_token = tokensCache.access_token.replace(/\.+$/, '');
Related