我正在使用此代码来执行这些操作,但我不知道如何从其中注销并从其他帐户登录。
UserCredential credential;
using (var stream = GenerateStreamFromString(secret))
{
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.Youtube, YouTubeService.Scope.YoutubeForceSsl, YouTubeService.Scope.Youtubepartner, YouTubeService.Scope.YoutubeUpload },
email,
CancellationToken.None,
new FileDataStore(this.GetType().ToString())
);
}
string accToken = credential.Token.AccessToken;
youtubeService = new YouTubeService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = this.GetType().ToString()
});