Can I use Google Drive to upload images through an Android application. I also would not want the user to be involved in the process of authentication because all the images should be uploaded to a specific user's Drive only. I think this is only possible through a 2-legged OAuth but does a 2-legged OAuth exist for the Drive??
Thank YOu
2-legged OAuth does not exist on Google Drive. The nearest behaviour achievable is by using Service Accounts with impersonation. If you have a google apps domain, you can use Provisioning API to find the users of the domain and impersonate them progammatically
Related
I've been trying for a while now to create an application where the users can sign in with their Google Account and the application will automatically upload some files into the users google drive.
So far I've managed to implement the Sign In mechanism but for the Google Drive integration I'm kind of confused if I should use a Service Account or not.
I've found this solution here Google Drive API implementation Xamarin Android but this way too old, and I can't find any updated solutions.
If anyone knows any solution or any suggestion I will appreciate it.
Think of serive accounts as a dummy user, this user can then be preauthorized to access some data.
You could share a folder on google drive with a service account and then the service account would have access to that folder on google drive.
Service accounts are intended for use by developers to access data they control.
If you are going to access the users account then you will need to use Oauth2, and request consent of the user to access their google drive account.
Unforuantatly it appears that Google Drive Android API used in the question you have linked is deprcated.
I can also tell you that the Google .net client library does not support Xamarin authorization.
I am new to Android app development and have a few questions.
Suppose I want to create an app that has user login. I want to authenticate the users over the internet. Where should I collect and store all the user accounts and their credential information? Will this storage be free or paid?
Can I integrate Google Sign-in in my app for free? Where should I store the google sign-in account information of all the users?
Is it possible to integrate Google sign-in and backup the app database (.db files etc.) and other user settings to the user's Google Drive (for later recovery when app is reinstalled)? Is this free or paid?
Answering Questions 1 and 2:
There are a few options:
1) Firebase:
If you only want to work on the mobile app, not on the backend software, the easiest way is Firebase.
Firebase has built-in support for Google authentication and you can follow the tutorials provided by Google here, and the samples here. (I`m using the link because the code is too big to paste here on the answer.) The authentication service is free.
2) Self implementation:
You can use Google sign in API on this example and implement the server side if you have a backend team or want to do it yourself.
About Question 3 (Google drive), users can use their own Google account to store applications backups, and you can select what application files will be stored. In this case, they will consume their free Google Drive quota, and thus the service will be Free.
Google provides an API for that, and you can have have a look on this example here. (Notice that Google had deprecated Google Drive Android API on December/2018. But the example on the link shows what you have to do on the newer way, using Drive REST API).
There are other approaches and solutions but I tried to give you the simplest and cheapest ones.
I want to pass Gmail id and password and get the access to users drive. I don't want to use accounts that can be chosen using intent(account picker) instead i will provide edit-text to enter and user name and password, with which I should be able to access google drive for that user name and password.
Any suggestion how to do this?
The only way to access google drive through an app is through the google drive API OAUTH system, it's well explained on their docs:
About OAUTH
About authorization protocols
Your application must use OAuth 2.0 to authorize requests. No other
authorization protocols are supported. If your application uses Google
Sign-In, some aspects of authorization are handled for you.
I'm writing an app that requires a user sign in with Google on Android and then proceeds to get data from the server (a Google App Engine instance, in this case). How could I go about making sure that the user is actually logged in instead of just calling with a user ID? Is there a way for google to check a secure token they provide on Android for authenticity? Or is there another non-google related way to do this?
Thank you for the help!
Okay, so this is actually a very simple task. You ask Google Play Services for its OAuth Token and send that. Then the server asks Google about that token and Google will give it all of the information in the scope at once using one of their multiple limitless OAuth APIs.
Google accounts come with a pretty nice profile already, and since all Android phones connect to that profile for most of the google services. I'd like to add an option to my application to simply register with my application using your google profile on the phone. Not only would I have access to information like email address, name, aliases, but also profile images people use on google services.
Which Google API provides me access to that? Is there something in the Android API's that already provides this that I'm missing? I'm not just looking for authentication, as with OAUTH, but access to the profile information as well.
Are there any existing libraries I can use?
Turns out there is a way to get access to the google profile(s) the user has:
http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager
That's awesome.