What are the "User" and "Cancellationtoken" parameters for?

Asked

Viewed 169 times

2

I’m doing an implementation with the API from Google Drive, and in the code block:

 credenciais = GoogleWebAuthorizationBroker.AuthorizeAsync(
                    GoogleClientSecrets.Load(stream).Secrets,
                    new[] { DriveService.Scope.Drive },
                    "user",
                    CancellationToken.None,
                    new FileDataStore(diretorioCredenciais, true)).Result;

That serves to obtain the credentials, there are the parameters: "user" and CancellationToken.None, would like to know.

  • What are they?

  • What are they for?

1 answer

2


The parameter user is the user name you want to use to access the resource and the cancellationToken is used to ask for the execution to be stopped. Can’t any code do this, it needs to be one that created this asynchronous routine, so there is a token which is a kind of password that allows the operation.

  • I’m looking for a way where I don’t need to confirm my user. The Parameter user is related to this? I couldn’t understand.

  • You want to create a credential, but you don’t want to provide a user?

  • O Contrario, I’m being redirected to the google page to confirm the email. What I want is to send the account email along with the request, to avoid having to confirm.

  • That’s another problem right there.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.