Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions

There are two possible solutions depending on what kind of relationship you expect to have with the people that use the plugin.

  1. Instruct them how to create an app and which URLs to use to be compatibe with what you expect in the plugin, have a setting page at the wordpress admin in which they can either upload the secrets file or configure the app secrets.
    This option is easy for you hard for the user.

  2. Setup a proxy. Your plugin actually comunicates with the proxy and the proxy does the relevant API access, handles oauth redirects from google etc.
    This options is easy for the user but complicates your development, might cost you if you don’t have a place to host such a thing, but the biggest thing is the quota limits of google as you will be responsible to pay when you pass the free tier, or your code will need to keep track of the usage and stop before you pass the free tier.