Search code examples
c#gdatagoogle-analytics-apigoogle-oauth

GData Authentication for Server Apps


I have an application running on a server that periodically extracts data from Google Analytics. It doesn't issue many queries so I don't think any limit would be a problem.

I have a prototype running, however I had to provide a login a password for the authentication (in code).

I see that I can generate API keys and other kind of authentication bits and pieces in the Google APIs Console, however I am not sure how to use them and whether they can be used in place of the login/password.

It just doesn't seem right to use a user login/password to authenticate a server application.

Is there another way?

(I am using the C# client library)


Solution

  • You should be using OAuth 2.0. See:

    http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs

    for a sample OAuth workflow.