How to authorize access to Google Drive with OAuth2?


In my final year project I want to implement a client in which certain files are synchronized with your Google Drive account.

I'm trying to use the Google Drive API for Java and I'm pretty lost with the OAuth2 because all the sources I read indicate that you have to credit the application in Google Developers so you can access Drive.

What I need is for each person who uses the application to connect to their Google account to use their Drive directories.

Could someone help me with the issue of authorization with OAuth2?

asked by xero399 15.02.2016 в 20:53

1 answer


Indeed, you need to create a project in the google console.

After generating the credentials that you will use in your code and that only you should know, these will allow your application to throw the dialogue asking for permission for certain data (scope) of the user such as Google + , Google Docs or Google Drive in this case.

I leave you a tutorial very good to create your project and the necessary credentials in google from scratch.

Once you have access, it's a matter of working with APIs to view or manipulate the files of the current user.

answered by 16.02.2016 / 16:59