我試圖運行Google Drive的實時API的快速啓動代碼。 我相信我做的都對。但我越來越適用於Drive API的Google API OAuth不起作用。獲取錯誤:origin_mismatch
Error: origin_mismatch
Request Details
openid_connect_request=true
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/drive.install https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/plus.me
response_type=token
access_type=online
redirect_uri=postmessage
proxy=oauth2relay601571239
origin=http://127.0.0.1
state=811328575|0.818765953
display=page
client_id=XXXXXXXXXX
我試圖運行在以下鏈接鑑於谷歌驅動器的實時API的快速啓動代碼: https://developers.google.com/drive/realtime/realtime-quickstart 我認爲我得到錯誤,因爲我使用localhost作爲重定向URI和JS Origin。但是堆棧溢出的一些鏈接表示可以使用localhost。 http://stackoverflow.com/questions/11330919/correct-redirect-uri-for-google-api-and-oauth-2-0 如果您需要關於我的問題的任何其他細節,請告訴我。 – Rahul
您不能使用本地主機。你有2個選擇。 (1)將127.0.0.1 = mydevserver.example.com編輯到你的/ etc/hosts中,(2)使用url縮短器(例如goo.gl)爲localhost創建一個別名 – pinoyyid
非常感謝,我使用了第一個選項,它爲我工作。第二選項沒有起作用。非常感謝你。 – Rahul