C# 谷歌日历api-对许多用户的请求

C# 谷歌日历api-对许多用户的请求,c#,google-api,google-oauth,google-api-dotnet-client,google-calendar-api,C#,Google Api,Google Oauth,Google Api Dotnet Client,Google Calendar Api,我的应用程序应该在用户日历中创建一个事件 我已为所有要在其日历中创建新事件的用户设置了刷新令牌 我对谷歌日历客户端使用NuGet包,但当我初始化谷歌日历客户端时,我只能初始化单个刷新令牌 var token = new TokenResponse { RefreshToken = "single token only" }; var credentials = new UserCredential(new GoogleAuthorizationCodeFlow( new

我的应用程序应该在用户日历中创建一个事件

我已为所有要在其日历中创建新事件的用户设置了刷新令牌

我对谷歌日历客户端使用NuGet包,但当我初始化谷歌日历客户端时,我只能初始化单个刷新令牌

var token = new TokenResponse { RefreshToken = "single token only" };
var credentials = new UserCredential(new 
    GoogleAuthorizationCodeFlow(
        new GoogleAuthorizationCodeFlow.Initializer {
            ClientSecrets = new ClientSecrets() {
                ClientId = "id", 
                ClientSecret = "secret"
            }
        }
    ),
    "user",
    token
);

var calenderClient = new CalendarService(new BaseClientService.Initializer() {
    HttpClientInitializer = credential,
    ApplicationName = ApplicationName,
});
如何添加另一个用户刷新令牌


谢谢

这就是api的工作原理。您可以为每个您为该用户验证的用户获取一个刷新令牌,然后您可以向他们的日历中添加一些内容。如果要对另一个用户执行相同的操作,则需要使用该用户的刷新令牌进行身份验证,然后添加事件


您的代码看起来不错,只需为每个刷新令牌循环它

你有什么错误?