Google API OAuth for Drive API is not working. Getting Error: origin_mismatch

后端 未结 2 673
-上瘾入骨i
-上瘾入骨i 2021-01-05 20:34

I am trying to run the quick start code of Real Time API of Google Drive. I believe I did everything right. But I am getting

Error: origin_mismatch

Request         


        
2条回答
  •  生来不讨喜
    2021-01-05 20:58

    You haven't given much detail about your application architecture, so i can only suggest a general answer. OAuth restricts which URLs can be referred to it. The list of permitted URLs is configured in the API console at https://code.google.com/apis/console. The URL is very fussy, so make sure you enter it exactly as it appears in the address bar.

    As at Oct 2013, you can't use localhost. You have 2 choices.

    1. edit 127.0.0.1 = mydevserver.example.com into your /etc/hosts
    2. use a url shortener (eg. goo.gl) to create an alias to localhost

    However, I believe that it is now possible to configure localhost in the Google api console.

提交回复
热议问题