2015-05-04 75 views
0

我知道有一個非常類似here。但是,這假設您正在開發一個上傳到您自己的服務器域的HTML應用程序。 當我在Google網站上工作時,如何設置API project console中的Javascript起源?Google Apps腳本 - Google Site中的origin_mismatch錯誤

enter image description here

我的谷歌網站的URL看起來像https://sites.google.com/a/domain-name.com/site-name/page-name

  1. That’s an error.

Error: origin_mismatch

Application: Custom form

You can email the developer of this application at: [email protected]

Request Details immediate=false response_type=token scope= https://www.googleapis.com/auth/drive.readonly redirect_uri=postmessage proxy=oauth2relay945850002 state=845063282|0.3789568949 origin= https://n-qaqvqexe4f52wy3jge4j7oquqn5qtfw3gn4sumq-script.googleusercontent.com include_granted_scopes=true client_id=498878908299-opvf61qsrpr6en5kvh74esqbmii1nc7u.apps.googleusercontent.com authuser=0

:因爲它說,起源域不能containt像 http://example.com/subdir

這裏的路徑是,我得到的錯誤,我不能粘貼URL

而且this的是,我使用

+0

你有沒有試過https://sites.google.com?在JavaScript的起源? – DaImTo

+0

是的,沒有工作.. – maeq

+0

該文檔指定你應該「創建新的鍵」類型的「瀏覽器鍵」,但你創建的是「客戶端ID」。客戶端ID基於回調或起源而工作,而密鑰在引用者上工作。 – abraham

回答

0

浪費很多小時後,示例代碼,後ss_domain=到授權的JavaScript源爲我工作添加URL。

  • 從錯誤窗口中單擊請求詳細信息,查找ss_domain並將該uri複製到JavaScript起源中。