insufficient permission: request had insufficient authentication scopes google people

Viewed 13

string[] scopes = new string[] { "https://www.googleapis.com/auth/contacts" };
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret } , scopes, "test", CancellationToken.None, new FileDataStore("test")).Result; PeopleServiceService peopleServiceService = new PeopleServiceService(); Person contactToCreate = new Person(); List names = new List(); names.Add(new Name() { GivenName = "John", FamilyName = "Doe" }); contactToCreate.Names = names; PeopleResource.CreateContactRequest request = new PeopleResource.CreateContactRequest(peopleServiceService, contactToCreate); //request.AddCredential(credential); request.Credential = credential; Person createdContact = request.Execute();

0 Answers
Related