About using google drive api to one application that allow all registered user in drive to save a document - google-apps-marketplace

I am designing one application that use google API so all users can save file in their account. My question is, how i have to manage API Key in that scenario?
Example:
Suppose user Peter has a google drive account, then he login in my app and save the file, the same for all users that loggin in my app.
Best regards.

Related

Can I use single Google API credential for multiple deployed microservices for same user on different instances?

Application1 -> Microservice1 (deployed on one server, also db is separate)
Application2 -> Microservice2 (deployed on other server, also db is separate)
NOTE : For Microservice1 and Microservice2 we are use same Google API credentials.
We have a one application in that we are providing user to edit it's word, ppt, excel files with Online editor.
So, we have configure Microservice which used GSuite API for user to edit there file with google online word editor.
Now, we have a scenario like when one user open file from Application1 then our application will redirect user to google login screen and once user enter it's credentials then google will check whether third-party application already registered with login user account or not, and if not then google will give consent screen to register third-party app with current user.
Once user allow third-party app then google will redirect user to our Microservice1
once callback came to our Microservice then we will store user's refresh-token to our db and user can able to edit document online.
Now, user open file from Application2 and it will redirect user to google login screen and once user enter it's same credentials which he used in above then google will check whether third-party application already registered with login user account or not, this time google found that third-party application already registered with them, and google will redirect user to Microservice2, but this time google doesn't give refresh-token and in our db also refresh-token entry not there, so we will not able to open the file in online editor.
So, is there any way to handle these kind of scenario with only single Google API Credential?
Or we need separate account which give us different Google API Credentials?
Like :
Microservice1 (One Google Account with Google API Credential)
Microservice2 (Another Google Account with Google API Credential)
Any kind of help appreciated.
Thanks in advance...
you need to create a service account, possibly with G Suite Domain-Wide Delegation of Authority.

Google Api Service Account authentication access to developers data

I want to develop an application that uses the Picasa Google API for uploading images to my own account. I've already created the Service Account from the API Console and have created the code to upload the image (which works correctly given a valid access_token obtained from the OAuth2 playground).
However, when trying to obtain an access_token with the Google-api php library, this one doesn't seem to be associated to my own username (obviously, no consent screen), which throws me a 404 Not found error message when trying to access data from my personal account.
From what I've read over at https://developers.google.com/api-client-library/php/auth/service-accounts I could create an apps account to setup permissions for a whole domain. Is this, however, necessary given that I only want to access information from my own account? (the same I used to register the application in the API console). Couldn't this be done beforehand using API panel?
A service account is not you and does not by default have access to any data. Think of a service account as a dummy user. If you take the service account email address and add it as a user on a folder in your google drive it will have access to that folder on google drive. If you take the service account email address and give it access to one of your calendars on Google Calendar it will have access to the calendar.
If you set the album public I suspect it will then have access to the album. I did some Googleing and I cant see how you can add another users email address to an album on picasa.
I suggest you try using Oauth2.

Getting list of documents related to a particular user in Google Apps using Admin Account

i am creating an app using google apis.i need to access user's documents through google apis using google admin account.In past i can use google docs api like this
for example i am admin of domain iritesh.com and my email address is ritesh#iritesh.com.i logged in using admin account and can retrieve documents in google drive of rajat#iritesh.com using user_id = rajat#iritesh.com.
https://docs.google.com/feeds/"+user_id+"/private/full/folder:root/contents?v=3&alt=json
but now google docs api's are deprecated.can anyone please guideline How to acheive this using google apis now.
link reference : https://developers.google.com/google-apps/documents-list/#using_google_apps_administrative_access_to_impersonate_other_domain_users
With the new API's and OAuth 2 you can accomplish this functionality but for it you will have to use Service account with domain wide delegation.
Basically with the service account it would be possible to impersonate users in the domain and make API calls in user's behalf. For getting information about documents you will use the Drive API.
Here is the documentation on service account:
https://developers.google.com/accounts/docs/OAuth2ServiceAccount
And Drive API:
https://developers.google.com/drive/v2/reference/
hope this helps.

Developing an external Google drive sdk application

Im quite new to developing apps that make use of google drive and google api in general. I would like to know whether it is possible to have an application that exposes files saved on google drive without users having to login to their own google drive account. So in a sense the app would have an account and would list the documents that are currently stored on drive and users would be able to click on them ( via Google picker and not Drive UI) and view them.
Note: The app is an external ASP.NET MVC web application.
I've looked at all the authentication samples available (DrEdit etc) on the Google dev site but now of them seem to address my problem.
Seems like you could manually run through the authentication against your own Drive account, and then store the initial access token and refresh tokens in your CredentialStore implementation, which your app will continue to use.
CredentialStore is from the Java API - I'm sure there are equivalents in the .NET API.

APP Inventor get current user functionality

I know on the Google App engine there is support for Google Accounts via user = users.get_current_user() functionality. I have used this and then I request the user to create account on my app. Is there anyway for the phone app to gain assess to the the user = users.get_current_user() functionality?
I have seen the example of creating a register / login on AI and storing it on TinyDB but the Google UserID is already available on the app engine. How do I access this functionality on the phone app?
with OAuth you can ask the user for permission to view his email address and read that information from his Google profile, see an example how to do that with App Inventor here http://puravidaapps.com/taifunOA.php
No, this feature does not exist. It has been proposed and can be voted for here.

Resources