What are the "User" and "CancellationToken" parameters used for?

2

I'm doing an implementation with API of 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;

What is used to get the credentials, there are the parameters: "user" and CancellationToken.None , I would like to know.

  • What are they?

  • What are they good for?

asked by anonymous 22.12.2017 / 14:34

1 answer

2

parameter user is the username that you want to use to access the resource and the cancellationToken " is used to be able to ask for execution to be interrupted. You can not do any code to do this, you need to be one that created this asynchronous routine, so there is a token that is a kind of password that allows the operation.

    
26.12.2017 / 20:20