Can't get Google Drive API share dialog to work when signed into multiple accounts

前端 未结 2 1878
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 02:53

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.

2条回答
  •  有刺的猬
    2020-12-31 03:09

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

    Google Drive API, can't open standard sharing dialog via JS (x-frame-options error)

    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.

    it is stated here in google documents that :

    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.

    source:

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

提交回复
热议问题