title: How to whitelist AWS Lambda function for Google API
body: <p>I'm building an AWS Lambda function that pulls info from the Google Calendar API using Node.js. The Node application then sends an html response to a third party application. I'm basically following <a href="https://developers.google.com/calendar/quickstart/js" rel="nofollow noreferrer">this guide from google</a>, except I'm sending the html somewhere else to be rendered. I keep running into an error where Google tells me I haven't whitelisted the javascript origin coming from Lambda. Here's the error text:</p>
  
  <p><code>{error: "idpiframe_initialization_failed", details: ""Not a valid origin for the client: https://&lt;Lambda URL&gt;.execute-api.us-west-2.amazonaws.com has not been whitelisted for client ID &lt;My_Google_API_Client_Id&gt;.apps.googleusercontent.com. Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID."}</code></p>
  
  <p>I've gone into the Google API developer console and whitelisted that URL, but I'm still getting that error. <a href="https://i.stack.imgur.com/wTEow.png" rel="nofollow noreferrer">Here's a screenshot.</a> </p>
  
  <p>I've tried whitelisting "us-west-2.amazonaws.com" as well with no luck. Thanks!!</p>