NewPath-Consulting / warm

Pro Reports for Wild Apricot is a Google Data Studio connector that helps Wild Apricot administrators understand your organization’s membership engagement, renewal rates, and demographics. Trend your revenue and get expense analyses. Whatever your question, enjoy all the organized data you need at your fingertips to make the business decisions want.
https://newpathconsulting.com/warm
GNU General Public License v3.0
6 stars 4 forks source link

Implement the getAuthType() approach to configuring the APIKEY for Wild Apricot authentication #92

Open asirota opened 2 years ago

asirota commented 2 years ago

Google has delisted our public Data Connector from the library of 3rd party connectors for the following reason:

Use appropriate authentication methods in getAuthType(). Do not request credentials via getConfig(). Please mention the "API Key" in the getAuthType() method.

There is some background on Stackoverflow on this.

Google has stopped allowing connector developers to collect API keys as a configuration parameter of the connector configration. We are currently doing that using getConfig(), which is a no-no.

The alternative new way is to use the getAuthType() approach which prompts for an API key to be collected during the configuration flow. But this means we will have to change any reference to configParams.apikey to use the new approach.

There are 4 functions that work to get authentication getAuthType, resetAuth(), isAuthValid() and the setCredentials() https://developers.google.com/datastudio/connector/auth#getauthtype

We are validating the API key configured through getConfig() in line 345, 397, 511, 528, 583, and this needs to be changed to support this new approach. Once this is done we can republish the plugin. The getConfig() approach is in lines 31-51 and will need to be removed and replaced.

asirota commented 2 years ago

A note: using this approach we could probably not only check the API key but also check the License key. Issue #31 describes how that would work.