0

I have a scenario where my application opens a document in google drive and allows user to edit.

Now if I want multiple users to edit the document, how (what google api-oauth/openconnect/identity federation/sign in) should I use to authenticate users and get their profile info. So that each user can access the same document and edit it.

Currently, I am authenticating using service account and allowing anonymous access. How can I implement the above scenario? What API's might help me to look at?

Kindly guide!

Atihska
  • 4,803
  • 10
  • 56
  • 98

1 Answers1

0

You can actually use Google Drive Rest API which uses these authorization protocols:

  • OAuth 2.0 to authorize requests, or
  • if your application uses Google Sign-in, some aspects of authorization are handled for you.

You can follow this general authorization process for all application types as given in Authorizing requests with OAuth 2.0:

  1. When you create your application, you register it using the Google Developers Console.
  2. Activate the Drive API in the Google Developers Console.
  3. When your application needs access to user data, it asks Google for a particular scope of access.
  4. Google displays a consent screen to the user, asking them to authorize your application to request some of their data.
  5. If the user approves, then Google gives your application a short-lived access token.
  6. Your application requests user data, attaching the access token to the request.
  7. If Google determines that your request and the token are valid, it returns the requested data.

In addition to that, if your app requires access to any other Google APIs, you can add scopes as given in OAuth 2.0 scope information for the Drive API detailed in the documentation.

For more information, please go through the given documentations and you may also add Using OAuth 2.0 to Access Google APIs in your references with regards to Google API scopes.

Teyam
  • 7,686
  • 3
  • 15
  • 22
  • Thanks for your reply. So what I am trying to achieve here is that the document is central like it's not in any user's drive but service account. And whoever user comes in, they authenticate and access. So I want for each user to get that login and consent screen to be displayed. Is this possible? Does it make any sense? – Atihska Jun 23 '16 at 18:19
  • Guys, could anyone please help here? I still don't have an answer to this question! – Atihska Jul 05 '16 at 21:12