Tag: google plus domains

如果我已经拥有Access Token的值,如何创建UserCredential的实例?

所以我有这个代码 我的问题是如果我已经通过OAuthvalidation了如何配置UserCredential ? 当前场景是代码将显示另一个重定向到谷歌的登录页面。 由于我已经使用asp.net MVC通过OAuth进行了身份validation,并且我已经拥有令牌如何摆脱GoogleWebAuthorizationBroker并直接传递令牌? string[] scopes = new string[] {PlusService.Scope.PlusLogin, PlusService.Scope.UserinfoEmail, PlusService.Scope.UserinfoProfile}; UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = “xxx.apps.googleusercontent.com”, ClientSecret = “xxxx” }, scopes, Environment.UserName, CancellationToken.None, new FileDataStore(“Store”)).Result; PlusService service = new PlusService(new BaseClientService.Initializer() { HttpClientInitializer = credential, ApplicationName = “ArcaneChatV2”, }); PeopleResource.ListRequest listPeople = service.People.List(“me”, PeopleResource.ListRequest.CollectionEnum.Visible); listPeople.MaxResults = 10; PeopleFeed […]