【发布时间】:2015-02-22 15:14:25
【问题描述】:
我在我的应用程序中使用 Google 的 .NET SDK,并希望获取用户信息。
我使用以下范围获得了UserCredential 对象。
new[] { Uri.EscapeUriString("https://www.googleapis.com/auth/userinfo.email"),
Uri.EscapeUriString("https://www.googleapis.com/auth/userinfo.profile") }
在此之后,我正在寻找 UserInfoService 来获取用户的姓名和电子邮件,但找不到。
请注意,我只使用 Google 的 SDK,并没有自己处理请求和响应。
我在其他网站上发现了一些示例,但这些示例不使用 Google API,并且正在形成
请求 url,并且需要解析响应 JSON。
有没有一种方法可以让我在不创建请求 url 的情况下获得 UserInfo 并将其留给 Google API 处理?
【问题讨论】:
标签: c# oauth-2.0 google-api google-oauth google-api-dotnet-client