问题
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