我有silverlight oob应用程序,需要添加Google OAuth 2.0 我正在使用此article作为参考:
我尝试使用WebBrowser控件向Google Auth服务发送请求。
代码示例非常简单
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(结果是相同的)
无论如何都可以在Silverlight App OOB版本中使用它
答案 0 :(得分:1)
最后我找到了解决方案。只需在浏览器外设置中检查在浏览器外部运行时需要提升信任。