问题
I want to upload files to google drive. I'm using C# and have referred following links to get started
- https://developers.google.com/drive/v3/web/quickstart/dotnet
- https://developers.google.com/drive/v3/web/manage-uploads
I'm able to upload the file successfully to google drive but my main concern is I don't want to display any sort of UI/human interaction. It should be able to automatically upload the file.
Using OAuth2.0 there is a need that we have to manage and generate access/refresh token. I have no idea how these should be managed.
Isn't there any other way where the user can have access to google drive programmatically just by sharing his/her Gmail account username/password to achieve this?
回答1:
Isn't there any other way where the user can have access to google drive programmatically just by sharing his/her Gmail account username/password to achieve this?
No there is not
The user needs to authorise your app one time. After that, you can save Refresh Token and use that for future unattended use.
来源:https://stackoverflow.com/questions/46066239/upload-file-to-google-drive-without-human-interaction-via-sdk