0

I'm developing an Android application where the user has requested to use Google Drive as a bootstrap CMS while they develop a real CMS for the second version of the app. This means they will want to access the Drive console and edit documents in it, and our app will then need to retrieve these.

I've determined that the best way to do this is using a regular Drive account that is application-owned, as described here:

Use regular Google accounts as application-owned accounts

This requires us to get OAuth2 credentials for the user. The article linked above links to a secondary article about doing that:

Retrieve and Use OAuth 2.0 Credentials

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

How do I get the authorization code given the login/pass combination, and is that really the simplest way to get the OAuth2 credentials once I have?

Moreover, what does the state parameter do and how do you set it?

Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96
  • Spooling around has indicated this https://accounts.google.com/o/oauth2/auth may be a relevant link for getting the auth code. – Andrew Wyld Feb 21 '13 at 12:05

1 Answers1

0

You can get the auth token by following the steps here:

Using OAuth 2.0 for Web Server Applications

The state parameter is described here:

google oauth2 redirect_uri with several parameters

and is an encoded string that allows the redirect URL to pass back state to the web app being used to get the OAuth2 token.

Community
  • 1
  • 1
Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96