2016-07-13 35 views
0

我在Gmail身份驗證中使用OAUTH2。它的工作正常。但Google apis會將身份驗證請求重定向到計算機上的默認Web瀏覽器。我在我的應用程序中添加了Web瀏覽器控件,並且想要在其中重定向身份驗證請求。我怎樣才能實現它?如何將Oauth2請求重定向到應用程序Web瀏覽器

userCredentials = GoogleWebAuthorizationBroker.AuthorizeAsync(ClientSecret, 
                    scopes, 
                    Username, 
                    System.Threading.CancellationToken.None, 
                    objFileDataStore).Result; 

回答

0

您似乎在使用Google .net客戶端庫。目前,Google .net客戶端庫不支持在Web瀏覽器控件中啓動身份驗證窗口。它將始終啓動默認的Web瀏覽器。

有一個向圖書館添加此功能的拉取請求,但Google拒絕將其添加到圖書館。 Add option to use Winforms embedded browser #547

相關問題