2013-11-25 91 views
0

這是一個直接跟進在這個問題上提供的信息,登錄到谷歌帳戶要遵循此蟒谷歌教程:錯誤教程使用Python

由於界面變化很大,我遇到了一些問題。

我最大的問題是在步驟1 - 3b。我不得不粘貼這些值:

http://localhost:4567 
http://mysite.example.com 
https://mysite.example.com 

在某些地方,但我不知道在哪裏。

所以我簡單地與教程繼續進行,在端口啓動的應用程序在我的本地現在4567

,應用程序啓動很好,但是當我點擊登錄按鈕,我得到一個錯誤:

Error:invalid_client 

no registered origin 
Request details: 

    scope=https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.moments.write https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/plus.profile.agerange.read https://www.googleapis.com/auth/plus.profile.language.read https://www.googleapis.com/auth/plus.circles.members.read 
    redirect_uri=postmessage 
    state=303270744|0.3942616991 
    origin=http://localhost:4567 
    display=page 
    request_visible_actions=http://schemas.google.com/AddActivity 
    cookie_policy_enforce=false 
    response_type=code token id_token gsession 
    access_type=offline 
    cookie_policy=single_host_origin 
    proxy=oauth2relay678941372 
    client_id=933139289991-iigr70l8u8rbjecm6vrrs3bj4fck0ptu.apps.googleusercontent.com 
    authuser=0 

我是否收到此錯誤,是因爲我所遵循的教程非常過時,或者因爲我沒有正確執行步驟1 - 3b?

我該如何解決這個問題?我想要的只是登錄到一個谷歌賬戶,如果有一個更簡單的方法與python做,請隨時讓我知道:S

回答

2

問題是,教程告訴你如何設置項目使用Google API控制檯(請參閱第1步中的第一項),但Google正在慢慢地將人們轉移到使用雲控制檯。因此,如果您遵循該鏈接,就會重定向到新的雲控制檯。如果你想回API控制檯(這樣你就可以按照所列的步驟的其餘部分),你應該在這個頁面的頂部,說看到一條消息:

Welcome to the new Google Cloud Console!

如果點擊在「返回」鏈接上,您將回到API控制檯,您可以按照教程中列出的其餘步驟操作。

步驟1-3b很重要,因爲它們是您如何設置項目,指出它可用的API資源,並指出您將如何訪問項目。它還會爲您提供您的Python程序在連接到Google服務器時使用的客戶端ID和密碼。

+0

謝謝!有沒有關於如何使用雲端控制檯的教程? –

+1

目前還沒有,因爲雲控制檯尚未最終確定。但是你應該能夠在'APIs&Auth' - >'Registered apps'下找到大部分相同的功能 – Prisoner