Permanently authorize a Google Sheets - java

I'm making a project that involves an App Engine (Java) Server that creates a spreadsheet on a weekly basis. The spreadsheet will be created on behalf of an actual Google user.
How do I configure my app to be given permanent[1] access to read/write/create a Google Sheets?
Can I use the same method[1] to access my user's Google Sheets permanently?
[1]The app is currently using a permanent (until revoked) access to the Admin API. I need a similar kind of OAuth2. https://developers.google.com/admin-sdk/directory/v1/guides/delegation.

Related

Android Graph API

I have just developed a new Android app for my company.
On the home page of the app we would like to display a number of our companies latest Facebook posts.
When send the request to the API i am receiving the error
"message": "(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. https://developers.facebook.com/status/issues/205942813488872/"
I have looked into this extensively and understand it is due to Facebook upgrading their APIs due to the recent data breach.
Within the app i have successfully implemented the Facebook Login API and can retrieve a new access token for the user.
I have generated all the necessary hash keys for the android app and have set it all up correctly on the facebook developer console.
I can achieve the functionality i require by getting the Access token from the Facebook developers Graph API Explorer however, this is not a good implementation as it is linked to my Facebook account and also only lasts for an hour.
The Facebook API states that public pages can be accessible using any user access token.
Is there currently anyway at all to use a user access token generated from the user login to retrieve a Facebook page data.
the only data i wish to retrieve is; the message, the time created and the image.
Is this possible with the current state of the Graph API or is it just a waiting game to see what Facebook will do next in the coming weeks?
Thanks.

The proper way to manage a Google Drive account using Java console application?

I have enabled Google Drive API on Google Developer Console and created a service account credential which is bundled with a service account ID and key ID. Despite that I have tried various ways to manage my own Google Drive account, I could not find a solution which fits for my aim. I need to upload, download and delete the files stored in my own Google Drive. The application that I am going to connect Google Drive is a console one which will be solely used for an academic research.
it's pretty simple. The steps to achieve this are at How do I authorise an app (web or installed) without user intervention? (canonical ?)
Be careful about how securely the refresh token is being stored and what scopes you grant to the app.

Creating files go to which account using Google Drive APIs when authenticating with a service account?

I'm trying to make use of the Google Drive APIs to send a log file created by our application to our company's Google Drive Account that we share for Android Development. Most of the examples showed how to use oAuth2 to authenticate with the end-user's Google Drive Account, but we want the files to be sent to just our Google Drive Account.
After some searching I found that I should create an API project for our app and use a Service account associated with that API Project to generate a key which we include in our project as a raw resource to authenticate using oAuth2 to get a GoogleCredential which is needed to build the Drive service we will use to make our API calls.
After authenticating properly, I was able to insert a file using the code example on the Google Drive API site and that appears to work properly, however I cannot see the file in our Google Drive account which created the API Project/Service account. Despite this, if I call Drive.files().list().execute() and output the FileList to a string I was able to see the files our app has previously inserted into the Service account's Google Drive.
So my question is: Is there a new Google Drive account created for the Service account that is separate from the Google Drive account that created the Service account? If so, is there a way to login to that account and view the files using the normal Google Drive Web UI so that we can get to the log files without writing some other application that authenticates with the Service account and then grabs the files?
It appears my question ended up being a duplicate, the other question one was just a little bit hard to find for me. The question is I can't see the files and folders created via code in my Google Drive and it was answered by a Google employee: https://stackoverflow.com/a/12218662/994519

Allow google app engine app to access google drive by default

I am trying to save some reports (in csv) on google drive from google app engine. It works fine if I hit the URL directly (after it bounced to google for authorization and click thru the screen to allow the app to access google drive)
But what if I initialize the request from cronjob in google app engine. Is there a way to let the app by passes the click thru? (or have a forever valid token?)
Note: same google account for the app and drive
For your app to access a user's data using a cron job, you will first need to get a set of OAuth 2.0 access and refresh token from the user: this should have been already implemented by you through the "click thru".
Once you get those credentials, you just have to store them in the datastore and retrieve them in the cron job in order to perform your tasks.
Retrieve and Use OAuth 2.0 Credentials shows an example of how to build an authorization flow and how to store/retrieve OAuth 2.0 credentials. Your cron job will simply need to retrieve those stored credentials and use them as usual.

java- oauth with google picasa data api

I have a requirement where I want images to be stored/retrieved from a single Google Account (this account has picasa storage). This should be done even if the user who is logged in to my web app, is different from the single google account (which has picasa storage).
(I plan to store all images used by this web app in Picasa Storage).
I couldnt find any example/reference for this particular scenario-- the docs talk about regular oauth authentication, where the user who is using the web app, gives permission to the web app to access his picasa images... What I want is, the single stored user (who has the images stored in his picasa account) is authenticated by the web app, even if a different user is logged in to the web app... Now the application can display images from the authenticated user's picasa albums...Can this be implemented? And ideally by using the google data apis client library for Java?
The answer is provided in Google Documentation of the API- at http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_java.html#ClientLogin
The user id and password has to be stored in the application, and irrespective of whichever user is using the application, auth into Picasa will be done for the stored user only.
This is referred to as Single-user "installed" client authentication in the docs...

Categories