Avoid exposure of API key and client ID when using Google Classroom browser API

旧巷老猫 提交于 2021-01-27 20:04:11

问题


I'm trying to use the Google Classroom Browser API. I referred to the page at https://developers.google.com/classroom/quickstart/js for the Quick Start for this API, but unfortunately it seems to expose my Client ID and API key in the script within the HTML.

Here's a link to the sample page provided by Google: https://github.com/gsuitedevs/browser-samples/blob/master/classroom/quickstart/index.html

The Client ID and API key are exposed on lines 34 and 35:

// Client ID and API key from the Developer Console
var CLIENT_ID = '<YOUR_CLIENT_ID>';
var API_KEY = '<YOUR_API_KEY>';

Is there any way I can use the Google Classroom Browser API without exposing my Client ID and API key? If not, how can I secure them and prevent unauthorised usage by anyone else?

来源:https://stackoverflow.com/questions/56714515/avoid-exposure-of-api-key-and-client-id-when-using-google-classroom-browser-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!