久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

登錄多個帳戶時無法使 Google Drive API 共享對話框

Can#39;t get Google Drive API share dialog to work when signed into multiple accounts(登錄多個帳戶時無法使 Google Drive API 共享對話框工作)
本文介紹了登錄多個帳戶時無法使 Google Drive API 共享對話框工作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

使用 Google Drive API 在 Javascript 應用程序中打開共享對話框時出現 JS 錯誤.錯誤是:未捕獲的錯誤:語法錯誤:DOM 異常 12.

I'm having a JS error when opening a share dialog in a Javascript application using the Google Drive API. The error is: Uncaught Error: Syntax Error: DOM Exception 12.

但是,當我退出所有 Google 帳戶然后只登錄一個帳戶時,共享對話框可以正常工作.當我在新標簽頁中登錄第二個帳戶后,共享對話框將不再起作用,并因上述錯誤而失敗.

However, the sharing dialog works fine when I log out of all Google accounts and then log into just one account. As soon as I log into a second account in a new tab, the sharing dialog no longer works and fails with the above error.

這與 非常相似在 Google Drive SDK 上調用 showSettingsDialog() 會引發拒絕顯示文檔,因為 X-Frame-Options 禁止顯示.但是,我已經完成了接受響應中顯示的調試,但無濟于事,即:

This is very similar to Calling showSettingsDialog() on the Google Drive SDK throws a Refused to display document because display forbidden by X-Frame-Options. However, I have done the debugging shown in the accepted response to no avail, namely:

  • 您在 Google API 控制臺的 Google Drive SDK 設置中設置的打開方式"網址必須與您使用共享對話框的頁面具有相同的域.
  • 目前,您還需要將您的應用程序安裝在您的 Google 云端硬盤上,以使可嵌入的小部件正常工作.我們目前正在努力消除此限制,因為自從我們推出 API v2 以來,它并不總是有意義.

相關代碼為:

var shareClient = new gapi.drive.share.ShareClient(rtpg.realTimeOptions.appId);
shareClient.setItemIds([rtclient.params['fileId']]);
shareClient.showSettingsDialog();

有沒有辦法讓登錄的多個帳戶也能正常工作?

Is there some way to make this work with multiple accounts signed in?

推薦答案

您可能需要仔細閱讀有關 x-frame 問題的內容:

you might want to read this carefully concerning the x-frame issue:

谷歌Drive API,無法通過 JS 打開標準共享對話框(x-frame-options 錯誤)

但我認為不可能一次對所有帳戶進行身份驗證,但每次您想要這樣做時,可能有一種解決方法setOAuthToken 對每個帳戶進行身份驗證.

but what i think it is not possible to authenticate all the accounts at once , but a workaround maybe to setOAuthToken to each of them everytime you want to do so.

在 google 文檔中說明:

it is stated here in google documents that :

重要提示:setOAuthToken 函數允許應用使用當前身份驗證令牌,用于確定選擇器使用哪個 Google 帳戶顯示文件.如果用戶登錄了多個 Google 帳戶,這允許選擇器顯示適當的文件授權帳號.

Important:The setOAuthToken function allows an app to use the current auth token to determine which Google account the picker uses to display the files. If a user is signed into multiple Google accounts, this allows the picker to display the files of the appropriate authorized account.

來源:

https://developers.google.com/drive/web/integrate-open

這篇關于登錄多個帳戶時無法使 Google Drive API 共享對話框工作的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 国产一区二区三区免费 | 婷婷五月色综合香五月 | 日韩精品在线看 | av国产在线观看 | 日本成人免费观看 | 亚洲一区二区视频 | 国产精品乱码一区二区三区 | 亚洲午夜精品一区二区三区他趣 | 一区二区三区亚洲 | 亚洲精品久久 | 四虎永久影院 | 日本精品一区二区 | 黄网免费 | 久久精品成人 | 在线电影日韩 | 国产污视频在线 | 一区二区三区高清 | 天天色天天射天天干 | 欧美激情国产日韩精品一区18 | 亚洲福利免费 | 亚洲一二三区在线观看 | 日韩国产一区二区三区 | av黄在线观看 | 国产重口老太伦 | 免费的av网站 | 中文字幕亚洲免费 | 亚洲天堂二区 | 日日摸夜夜爽人人添av | 午夜免费成人 | 国产www. | 狠狠干美女 | 俺去俺来也www色官网cms | 中文字幕免费 | 欧美一级电影免费观看 | 色综合久久伊人 | 亚洲精品一级 | 91色网站| 国产激情91久久精品导航 | 欧美自拍第一页 | 亚洲午夜av久久乱码 | 免费看的av |