Search code examples
google-apigoogle-api-console

How to bulk update "Authorized JavaScript Origins" in Google API Console?


Currently, I have been tasked to utilize the Google People API to ask for a user's basic Google information along with their public phone numbers. So far the results have been positive.

The solution my team and I have incorporated the Google People API integration in has the capacity to be utilized across thousands of domains. As a result, my question is simply, How can my team members and I ensure that any our clients that utilize our solution with their own particular domain get our new functionality built with the Google People API?

Keep in mind, our clients have the flexibility to have http/https and any subdomain on their site. Entering each domain possibility for our client base one by one would not be an easy task. I'm seriously hoping there is a solution around the single, explicit origin entries.

Thank you for your time and help.


Solution

  • Warning:

    You must remember that if this is source code you are giving your clients that you are not allowed to release your client id and client secret. This includes plugins and scripts.

    On November 5th 2014 Google made some changes to the APIs terms of Service.

    Asking developers to make reasonable efforts to keep their private keys private and not embed them in open source projects.

    So if your clients could view the code of your application and see your client id and secret you should not be giving it to them.

    Read more about this issue Can I really not ship open source with Client ID?

    Recommendation:

    The best solution for you will be to instruct your users now to create there own project on Google Developer Console and create their own JS origins.