0

I would like Google Drive to store document attachment to Google drive which I will do from a web application. These attachments can be done from a role of the users logged in using our local authentication system.

The problem is we don't want these users to know the email id and password associated with to log into this.

At the other end we don't want anonymous users to log in using oauth. I just have started learning Google Developer Tools so it would be nice if I get help.

Please find the diagram explaining about the problem:

enter image description here

jaykhatri
  • 123
  • 1
  • 10
  • in oauth2 there is no such thing as logging with a username and password. you would keep all tokens serverside so they are not exposed to clients (users) – Zig Mandel Aug 08 '15 at 20:16
  • Ok, can you show me some sort of example or code? – jaykhatri Aug 09 '15 at 04:30
  • please look at the official drive guide as it has a section dedicated to this. there is also the oauth2 docs, and the "oauth playground". You need to try them and then if there is a coding issue ask in s.o, – Zig Mandel Aug 09 '15 at 05:02

1 Answers1

0

Wait! You want your app to access the Drive of end users, by them giving you their Google password? Seriously? Not only is that madness, but I'm sure it is against the terms of use of their Google licence.

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
  • NoNo, I would like the login info of my google drive saved in the database and give a different password (of my web application) to the user. Once user is connected using those credentials, he will be able to access username password from the database and see the contents of google drive. – jaykhatri Aug 10 '15 at 13:32
  • please make your mind up. The question says "from a role of the users", then your comment says "my google drive". I appreciate that English isn't your first language, so use a diagram if necessary to explain what you want. I suspect this http://stackoverflow.com/questions/19766912/how-do-i-authorise-an-app-web-or-installed-without-user-intervention-canonic might be the answer you're looking for. – pinoyyid Aug 10 '15 at 18:09
  • I have added diagram for your understanding – jaykhatri Aug 11 '15 at 11:50
  • Cool. The answer I linked above will do what you want – pinoyyid Aug 11 '15 at 15:44
  • I tried your solution with google playground, so far I understood is to use access token and refresh token to get the access of Google drive. But sample .net code is like this `UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(secrets, SCOPES, getUserId(), CancellationToken.None, credentialPersistanceStore);` where we don't have option to put access token. Please help. – jaykhatri Aug 19 '15 at 08:25