gmail api - python, how to write a desktop application without sharing the secret client credential? -


I'm writing an open source app in Python after this example:

I have correctly client_secret Json generated and successfully participated for that example.

Now .. consider I'm starting to write my code and according to google doc:

Alert : Your customer is private Keep a secret If someone receives your client secret, they can charge it against your quota, consume your quota against Google API Console, and request access to user data.

So, how do I share my app's code and keep client_secret.json secret at the same time?

OK, I found the answer here:

< Blockquote>

This flow is similar to shown in the use of OAuth 2.0 for web server applications, but with three differences:

  • When you create a Client ID, you specify That your application is an installed application, the result is a different value for the redirect_uri parameter.
  • Client ID and Client Secret from the Developer Console are embedded in your application's source code. In this context, the customer secret is clearly not considered as a secret.
  • The authorization code in the browser's title bar or http: // localhost port in the query can be returned to your application string.
  • In other words, if you specify that your project is "installed app" then when creating it in Google API Console, you can safely Can embed embedded code into code


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -