I am using “Google.Apis.YouTube.v3 Client Library1.8.1.1050” Nuget package for accessing API in Windows Phone 8. I am able to do sign in function successfully using this API. I am able to perform certain operations on YouTube API v3 only by logging in with authenticated Google account details. I am also able to get all feeds from Youtube using this API. Right now, I am facing one problem while using Google API V3 oAuth2. I am using following code to do login with Google account :
UserCredential credential;
using (var stream = new FileStream("clientdata.json", FileMode.Open, FileAccess.Read)){
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
// This OAuth 2.0 access scope allows for read-only access to the authenticated
// user's account, but not other types of account access.
new[] { YouTubeService.Scope.Youtubepartner },
"user",
CancellationToken.None);}
Using this code, I can successfully get signed in and able to get all feeds. But now my problem is how to logout from Windows Phone 8 application using Google API v3? As per my knowledge, there is no method available to clear user credentials in this package. For now, I am calling a webservice
https://accounts.google.com/o/oauth2/revoke?token={access token}
to revoke the current access token but this is not much helpful.
It would be great if I can get any help to get this problem fixed. And also let me know if it requires any corrections. It would be better if someone can provide the documentation or sample examples for how to efficiently use this API in Windows Phone.
Thanks in advance