Google oauth2 email.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string _client_id = "[From Google Developer Console]"; | |
string _client_secret = "[From Google Developer Console]"; | |
var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = _client_id, ClientSecret = _client_secret }, | |
new string[] {"email" }, | |
Environment.UserName , | |
CancellationToken.None, | |
new FileDataStore("Daimto.GooglePlus.Auth.Store")).Result; | |
// Now we create a Google service. All of our requests will be run though this. | |
var plusService = new PlusService(new BaseClientService.Initializer() | |
{ | |
HttpClientInitializer = credential, | |
ApplicationName = "Google Plus Sample", | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment