如何允许我的连接器用户在每次创建新源时设置不同的用户名和密码?

How can I allow users of my connector to set a different username and password each time they create a new source?

我已经为 TradeTracker 构建并发布了 Data Studio 连接器。连接器运行良好,但是当用户尝试通过尝试添加新数据源来添加不同的帐户时,他们无法重新输入他们的 API Clientid 和密码。如何清除 'old' 凭据?

我发现有一个重置授权的功能:https://developers.google.com/datastudio/connector/auth#resetauth

function resetAuth() {
  var userProperties = PropertiesService.getUserProperties();
  userProperties.deleteProperty('dscc.username');
  userProperties.deleteProperty('dscc.password');
}

什么时候调用这个函数?

您可以在此处找到数据工作室连接器:https://datastudio.google.com/u/0/datasources/create

搜索 'tradetracker'。

Data Studio 当前不支持多个身份验证配置文件。如果您想使用不同的凭据对数据源进行身份验证,则需要删除连接器(它将调用 resetAuth),然后再次添加并使用您的新凭据。

如果此功能对您有用,请file a bug,或对现有功能投票。在尝试为 Data Studio 确定新功能的优先级时,我们部分地查看了这个组件。