2012-09-13 52 views
0

我試圖通過我正在建設的sinatra應用程序訪問我自己的gmail帳戶。我在快樂如何解釋谷歌api oauth回調

https://accounts.google.com/o/oauth2/auth?response_type=code&&scope=https://mail.google.com/+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile&client_id=XXXXXXXXXXXX.apps.googleusercontent.com&redirect_uri=http://localhost:9393/oauth2callback&access_type=online

的形式發送給谷歌API的請求和本人授權通過谷歌的Web界面的應用程序後,我得到什麼似乎是正確的回調我自己的末日的應用程序。我不清楚在這個過程中我接下來要做什麼。什麼我從谷歌的身份驗證系統越來越看起來像

http://localhost:9393/oauth2callback?code=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

我再嘗試使用XOAUTH寶石然後查詢谷歌的信息,我的帳戶,即https://github.com/nfo/gmail_xoauth 我的希望是,上面的xxxxxx.yyyy字符串以某種方式對應於 的值:在xoauth gem文檔中寫入的令牌。當我運行本地腳本來檢查,如果一切正確工作,我得到一個Invalid credentials (Failure) (Net::IMAP::NoResponseError)

文檔我使用瞭解OAuth的過程https://developers.google.com/accounts/docs/OAuth2WebServer

我不認爲我管回調正確或者我誤解了它是什麼。

的思考?

回答