My requirement is to upload files to google drive without having user interaction.i need to use Oauth2 .i have tried with services account from that i can upload files and share .uploaded files will go to the "Shared with Me" section .Has any one come across with such issue. Is there any solution.
Asked
Active
Viewed 769 times
0
-
you'll need to add a lot more expalanatation to what you're trying to achieve, what you've tried, what did and did not work for you. In answer to the question "is there any solution?", the answer is yes – pinoyyid Aug 18 '14 at 05:51
-
@pinoyyid In google api console we can create 3 types of accounts.if we are using installed application or web application ,then when we request access token it will redirect to constant page to authorize my requirement is to perform that action without user interaction.My requiment is to develop a an application where different users can upload files to the web application and then the uploaded files should upload to centralized one google account . – Seth De Aug 18 '14 at 06:15
1 Answers
0
If I understand the question, you want to upload files to a Drive account owned by the application, rather than owned by the end user>
You can do this either by using a regular account or by using a service account.
To use a regular account, you (as the account owner) will need to do a one-off auth to get a refresh token, which you will store. You can then use this any time to generate the access token needed to invoke the actual Drive API. You can generate the refresh token using the Oauth Playground, so no need to write any code. This answer will help How do I authorise an app (web or installed) without user intervention? (canonical ?)