我正在嘗試執行使用Google登錄到我在vb.net開發的基於Web的應用程序中。我正在使用帶Telerik控件的VS2013。不幸的是,沒有有用的例子可用於vb.net和谷歌自己似乎不願意把一個爲vb.net。我有一個登錄按鈕,允許用戶通過他們現有的Google帳戶登錄我的應用程序。以下是相同的代碼。嘗試在vb.net中使用Google執行oAuth時出錯
Protected Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
Dim clientID As String = "xxxxxxxxxxxxxxxxx.apps.googleusercontent.com"
Dim clientSecret As String = "xxxxxxxxxxxxxxxx"
Dim scopes As String() = New String() {Google.Apis.Plus.v1.PlusService.Scope.UserinfoEmail}
Dim credential As UserCredential
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(New ClientSecrets() With {.ClientId = clientID, .ClientSecret = clientSecret}, scopes, "user", CancellationToken.None, New FileDataStore("Drive.Auth.Store")).Result
End Sub
儘管雙重檢查了一切,我仍然收到'redirect_uri_mismatch'錯誤。以下是錯誤的快照。
我已經對這個閱讀大量的文件,當它表明,它與重定向URL錯誤在谷歌開發者控制檯配置,但據我的關注,我認爲這是正確的配置。以下是我的Google控制檯客戶端ID的快照。
這裏是我的請求源的快照。
如果有人知道並願意分享這個問題,我將非常感激,因爲這真的讓我發瘋。
非常感謝
請問您可以發佈完整的代碼嗎? – 2015-04-06 08:47:12
http://www.codeproject.com/Tips/869770/Handling-events-in-google-calendar-using-google – 2015-04-06 09:24:27
許多感謝@Poornima。我會研究代碼,看看我的問題是否可以從這個問題中解決。很多再次感謝。 – 2015-04-06 09:40:51