【发布时间】:2019-02-23 07:41:17
【问题描述】:
我需要跨多个帐户连接到多个 Google 议程以获取活动。为每个要连接的议程调用以下函数,它适用于第一个查询的帐户,之后我收到上述错误。如何连接到下一个帐户,是否需要断开连接或取消设置以进行身份验证?
function runClient(apikey, client_id, calendar_id, post_id){
gapi.load('client:auth2', initClient);
function initClient() {
gapi.client.init({
discoveryDocs: ["https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest"],
}).then(() => {
gapi.auth2.init({
client_id: client_id,
apiKey: apikey,
scope: "https://www.googleapis.com/auth/calendar.readonly",
}).then(getUpcomingEvents(calendar_id, post_id));
});
}
}
【问题讨论】:
标签: javascript google-authentication