Google Drive API: The user does not have sufficient permissions for this file using API Key - vb.net

I'm trying to integrate Google Drive using the SDK with my app written in VB.Net using API Key and I'm following this tutorial https://developers.google.com/api-client-library/dotnet/get_started#simple
What happens is that when calling the ExecuteAsync method, I receive back an Exception saying that the user does not have sufficient permissions for this file.
Basically, I only have the API key (with restriction to access only Google Drive API) and I don't want to ask the user for permissions, because I'd like to use a specific account (so everyone would be sending files to that account).
I couldn't find a way to "link" this API Key to a specific account also.

I ended up using a service account for the Google Drive API.
The idea here was quite simple, where I created this account and downloaded a generated JSON file that is used by the SDK to Authenticate and call the API.
With this service account, I didn't use the API Key and I could leverage Permissions
and set permissions to each user on each created folder.

Related

Download files from a specific user's drive with google drive api

Is there a way to download files from a specific google drive, by using the google drive api? Currently i can only read the drive of the google user logged in.
Inorder to access data owned by someone on Google drive you need their permission. You can't just access my files unless I let you. The most common method for this is oauth2 but you can also use a service account.
Now if I set a file to public you would be able to read it using an API key but I would have to give you the file id.

Accessing a public google drive without authentication using Corona sdk

I have two public folders in my google drive and I want my app to be able read images from one folder and read and write images to another folder. Is there a way to do this using the google api or any GET method and hopefully without needing to authorize or authenticate the user's google account? Thank you!
It's a cross platform application being developed in Lua using the Corona sdk
Unfortunately, you cannot access a particular drive without any authentication/authorization.
Every request your application sends to the Drive API must include an
authorization token. The token also identifies your application to
Google.
Same question was also raised in this SO post.
But there is an alternative if you go further in the answer of the SO post. This link maybe useful if you want to try the alternative.

upload file to google drive without human interaction via SDK

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?
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.

Invite People to folder with Onedrive for Buisness RESTful API

I'm using the onedrive RESTful API to integrate a webapp and share file between a group of people. I manage to correctly authenticate a user and get its access token, create folders and upload files.
The problem I'm having is finding a way to invite people to a folder. The closest documentation I have found is about permissions, where it talks about updating permissions (read, write, creating links) however I cant get a way to invite a specific user to a folder like its done directly in the One drive official webapp OneDrive Invite people to folder img
We don't officially support adding permissions through OneDrive API yet. If you need to do this in a production environment right now you'd need to use the SharePoint REST API to add the user permissions.
In the near future we'll be adding an invite function to the OneDrive API. While we haven't released documentation on it yet, you can see the unofficial syntax for it by looking at the service metadata information for the consumer service (https://api.onedrive.com/v1.0/$metadata). Of course, usage of this API would not be supported until it is documented on dev.onedrive.com though.
-Ryan

Google drive API and auth

I want to create a web app letting any user upload a file to my Google drive and then be able to view it through the browser.
So far looking at Google's examples it seems I have to auth to my Google Drive on the server side (makes sense....) but also end-users have to auth before uploading anything to my drive using Oauth. Is there a way to prevent having to ask users to authenticate prior to uploading documents given that I am authorized through my server to my Google Drive account?
Allowing anyone to view a document is more straightforward through the use of a public folder...