How to use Google Identity Toolkit to connect to Google Drive API? - google-drive-api

I want to use Google Identity Toolkit to sign up and authenticate my users. In another part of my app, I want to use the Google Drive API to allow users to choose media files to link with their profile.
Will setting up GITKit make it easier to use the Drive API? Can I share credentials (i.e. API key) between the two services? Are they totally separate? I'm pretty confused so any help would be appreciated.

First of all, please consider to use Firebase Authentication, which is the new version of Google Identity Toolkit.
In both Firebase Authentication SDK and Google Identity Toolkit SDK, your app can specify the Google Drive scope when initializing the Google provider. In this way, once the end users sign into your app with Google, your app can get the Google oauth2 access token that has the permission for the Google Drive scope. Your app can call Google Driver API with that access token, without prompting the user.

Related

Are there any way to register in-house application in google apps marketplace with FQDN?

I belongs IT Section which provides and distributes Google Apps and its related service in our company.
Our section has disabled Drive SDK in Google Apps admin Console because of our company policy.
However, many developers requested Drive api in our company.
So, we started registering developer's drive application in google apps marketplace to allow it.
After our registration, developers could use drive api.
However, recently our registration process has stuck in uploading on Chrome Web Store.
(*Please take a look at See step 8.)
Strictly speaking, chrome web store publishing status become rejected.
Moreover, we received app removal notification from chromewebstore-dev-support#google.com, like "Chrome Web Store: Removal notification for app name."
But we have no idea why this app has been rejected.
Here is our step we used to do.
In google developers console, I accessed api manager, and make drive api enabled.
Access drive SDK settings to register app icon and open URL, and save it.
*About open URL, we assume intranet FQDN is forbidden, so we set http://www.google.com as open URL.
In OAuth Concent, type service name and save it.
From api manager, enable Google Apps Marketplace SDK.
We set application name, description, register icon, support URL and drive api scope(https://www.googleapis.com/auth/drive) and save it.
Also prepare zip file for Chrome Web Store that includes manifest json and app icon.
*In manifest json, we wrote app name, description, web app URL(we set google sites) and write as domain-installable.
Upload zip file to chrome web store, icon, screeen shot, promotional tile images, set web site(we set google sites.), category and languages.
In the end, set Visibility option as private and everyone at mydomain.
After published both chrome web store and google apps marketplace, access to marketplace to find published app in our domain.
allow access of drive app in marketplace.
*Above processes were executed on September in 2015,
I believe developer console UI has been dramatically changed for now, so these steps might not match current steps.
### Questions ###
Considering above results, I would like to confirm things below.
I would like to confirm our steps above is correct or not for registering drive application in Google App Marketplace.
By referring Both Apps Marketplace Guides and Apps Marketplace Frequently Asked Questions, I could not find detail for specific steps.
I are wondering whether we must obtain or prepare domain for web application and it must be open on the web or not.
Are there any way to register in-house application in google apps marketplace without publishing on the web(wondering can use FQDN or not).
Is it possible to create Google Apps Marketplace App using service account or client application with Drive API?
Thank you in advance.
1. I would like to confirm our steps above is correct or not for registering drive application in Google App Marketplace. By referring Both Apps Marketplace Guides and Apps Marketplace Frequently Asked Questions, I could not find detail for specific steps.
You seem to have done the steps right. But just to be safe, you can check out Publish your App page on the apps marketplace documentation.
Steps to Publish the app
Go to the Chrome Web Store developer dashboard
Upload the zip file
Add a detailed description of your app for the Marketplace listing
Add your screenshot(s) and promotional tiles for the Marketplace isting
Add the URLs for your app's websites
Set the category, region, language(s), and other configuration details
Note: To publish a private, domain-only app, skip the next step and see the instructions below.
To publish a Marketplace app that is only visible within your own domain, do not use the listing review request form. Instead, on the developer dashboard, locate the "Visibility options" section and select "Private / Everyone at yourdomainname.com" before you publish
2. I are wondering whether we must obtain or prepare domain for web application and it must be open on the web or not.
I'm not sure what you mean by this question, but once the domain has been set and app published, the application will appear in the "For [your domain]" section in the Google Apps Marketplace available on admin.google.com
3. Are there any way to register in-house application in google apps marketplace without publishing on the web(wondering can use FQDN or not).
If you mean private company-wide application, I think Google Apps for Work can do this feature (this will incur additional charge to you though)
4. Is it possible to create Google Apps Marketplace App using service account or client application with Drive API?
Yes, Drive API also uses Domain-wide delegation of Authority in which the domain admin can grant 3rd party apps access to user data.

What is google developer console and project

I need an access to google drive sdk to store and retrive data from web-server but when I tried to get the access, as explained in google drive quick start guide, It says to create project, why is that. and How exactly getting access to drive sdk works?
Google provides a mechanism to allow third party apps to access its APIs. The first step of the process requires you to register the application to Google, eg. so it can bill you for certain access volumes. Your app will be accessing the information, eg the Drive files of end users. They will need to grant permission to your app, so this is a second reason why the app must be registered.
In Google parlance, your app is known as a "Project" and you will "create" (ie. register) your project at the Google Cloud Console.

How to access users account different from Google API Console?

I'm trying to write an app with Google Drive SDK on android tablet.
This app will access the google drive space of the account user choose.
I followed the instructions on this link and it worked. https://developers.google.com/drive/auth/android
However, when I tried to access different account from the account I used on Google API console, the app failed.
For example, if I login Google API console with account "a#gmail.com" and do the authorization for my app, and then execute my app and choose "b#gmail.com" to access the google drive space, the access will fail. AS the result , the app could ONLY access "a#gmail.com".
Is this by design? Oris there any way that my app could let user choose the account they want?
Any help is appreciate! Thanks in advance...

Is it possible to determine user profile using Chrome Extension API?

Is it possible to determine which user profile is logged in Chrome from my custom extension using Chrome API?
Thanks!
There is no Chrome-API for that, the best (any only) way is to use oAuth:
https://developers.google.com/accounts/docs/OAuth2
UPDATE:
Yesterday Google has published news about the Identity API at the Chromium blog.
The Identity API may only work with packaged Apps!
Identity API
The Identity API allows packaged apps to authenticate users securely
using OAuth 2.0 without the user having to provide a username and
password directly to the app. The Identity API supports authentication
using Google Accounts as well as third party providers such as GitHub
and Foursquare.
The Identity API also gives packaged apps secure access to Google APIs
such as Google+, Calendar and Drive. As an example, Google Keep uses
the Identity API to authenticate users as well as to call the Google
Drive API to save notes to Drive. The Identity API uses a webview
based UI to show the OAuth consent dialog and when the Google+ API
scope is used, it allows users to control who can see their activity
on the app.
Source: http://blog.chromium.org/2013/07/richer-access-to-google-services-and.html
Documentation at developer.chrome.com: https://developer.chrome.com/trunk/apps/app_identity.html
If it's possible to do so, consider writing a Chrome packaged app instead. The Identity API will give you the information you need.

How do I change the authorization domain using Google Drive?

I have a Google Drive enabled application that I'm trying to get into the Google Apps Marketplace. It was rejected because:
Your request begins : https://www.google.com/accounts/o8/ud?openid
It should look more like :
https://www.google.com/a/DOMAIN_GOES_HERE/o8/ud
I've not been able to get an response from anyone at Google as to what this means.
We based our Drive operations on the Java DrEdit example.
Is it possible, using the Google API Java Client Library, to use the second domain above, if so, how?
Also, even if it can be accessed, does it have access to the file permission settings I need in order to perform the various Drive operations?
The answer is that it's not possible at this time. The variant of OAuth2 used with Google Drive does not permit forcing login to a particular domain.
The Google Apps Marketplace storekeepers should be allowing such applications to be accepted until a workaround is found.