Search code examples
amazon-web-servicesgoogle-analyticsoauth-2.0google-oauthaws-lambda

OAuth 2 - Authenticate with JSON file without directory


So im trying to set up un lambda from amazon web services a javascript that consults data from google analytics and drops it on a S3 Bucket, so far the script works fine since im authenticating with a client_secrets.json from my computer but now that im trying to do it from lambda i cant figure out how can i copy&paste the JSON content into the script and use it in order to authenticate? The main issue is that is should be able to authenticate itself without human intervention.

example


Solution

  • In the code i show above if you remove the from_json() and just leave the json_data it would work just fine, hope it helps.