I have just solved this issue and found that the problem was that I had created the OAuth credential as a web app rather than a desktop app. Delete & recreate the credential, update the client_secret.json file and all should be good.
You can check the json file .. the initial key should be "installed" not "web".
Hope this helps.