admin管理员组文章数量:1289828
I'm developing a plugin that inserts contacts into a custom table of the WordPress database (name, phone number, email). It is possible to enter data in this table either manually, through a form, or by importing it from WordPress users. I have also developed a feature to import contacts from Google Contacts (Google People). Everything works but I ask you: when I will provide the plugin to my customers how can I do to avoid also providing the client_secret.json
file with my credentials for accessing the Google API via OAuth2 together with the plugin?
Furthermore, in order to function correctly, I must also authorize the URI redirect in the Google console but I cannot know in advance the URL of the various sites where the plugin will be installed, is it possible to automate (perhaps always through the Google API) this insertion?
I'm developing a plugin that inserts contacts into a custom table of the WordPress database (name, phone number, email). It is possible to enter data in this table either manually, through a form, or by importing it from WordPress users. I have also developed a feature to import contacts from Google Contacts (Google People). Everything works but I ask you: when I will provide the plugin to my customers how can I do to avoid also providing the client_secret.json
file with my credentials for accessing the Google API via OAuth2 together with the plugin?
Furthermore, in order to function correctly, I must also authorize the URI redirect in the Google console but I cannot know in advance the URL of the various sites where the plugin will be installed, is it possible to automate (perhaps always through the Google API) this insertion?
1 Answer
Reset to default 1There are two possible solutions depending on what kind of relationship you expect to have with the people that use the plugin.
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.
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.
本文标签: apiGoogle credentials and redirect URI for Google OAuth2 in a WordPress pluginquestions
版权声明:本文标题:api - Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741422590a2377891.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论