79740538

Date: 2025-08-20 01:11:34
Score: 1
Natty:
Report link

For server-side .NET apps you should not use GoogleWebAuthorizationBroker (it opens a local browser). The right way is to use a Service Account with a key file. My suggestion is first Create a Service Account in Google Cloud, enable the Drive API, download the JSON key, and share the target Drive folder with that service account email.

Then use GoogleCredential.FromFile("key.json").CreateScoped(DriveService.Scope.Drive) to build your DriveService. This works on any web server without user interaction.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Vinay Kandula