2013-05-30 150 views
1

我的Silverlight OOB應用程序,需要添加谷歌的OAuth 2.0 我使用這個article作爲參考:Silverlight的OOB和谷歌的OAuth 2.0

我試圖用WebBrowser控制發送請求,谷歌驗證服務。

代碼示例是非常簡單的

 var url = new Uri("https://accounts.google.com/o/oauth2/auth? 
     redirect_uri=urn:ietf:wg:oauth:2.0:oob& 
     response_type=code& 
     scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile& 
     client_id=<my_client_id>"); 

     WebBrowser.Navigate(url); 

,但我不斷收到此錯誤WebBrowser.Navigate Attempted to perform an unauthorized操作。

我試圖http ://localhost爲REDIRECT_URI(結果是一樣的)

Isthere任何方式使Silverlight應用程序OOB版本這項工作

回答

1

最後我找到了解決方案。只需檢查要求在瀏覽器外設置中運行瀏覽器時提高信任度。