Obtaining OAuth2 credentials for use in an Android application with an account owned by Google Drive

I am developing an Android application in which a user has asked to use Google Drive as a bootable CMS, while they are developing a real CMS for the second version of the application. This means that they will want to access the Drive console and edit documents in it, and then our application will have to restore them.

I have determined that the best way to do this is to use a regular Drive account that belongs to the applications, as described here:

Use regular Google accounts as application-owned accounts

This requires us to obtain OAuth2 credentials for the user. The article linked above refers to a secondary article about this:

Obtain and use OAuth 2.0 credentials

In it, they show a program for obtaining OAuth2 credentials using an authorization code. According to the documentation for the drive, it is enough to do this once.

How do I get an authorization code based on a username / password combination and is this really the easiest way to get OAuth2 credentials if I have one?

Also, what does the status parameter do, and how do you set it?

0
source share
1 answer

You can get the authentication token by following these steps:

Using OAuth 2.0 for web server applications

The state parameter is described here:

google oauth2 redirect_uri

, URL- -, OAuth2.

0

All Articles