Not a valid origin for the client from Google API Oauth
I had a very similar issue to yours. I tried to add multiple whitelisted ports from localhost
and nothing was working. Ended up deleting the credentials and setting them up again. Must have been a bug on googles end for my setup.
Reseting Chrome cached solved it for me. Long press on Reload button, then Empty Cache and Hard Reload.
Note: Make sure your Chrome Dev tools panel is open otherwise long press wont work.