Cristian Lupascu
Cristian Lupascu

Reputation: 40536

Google Prediction API Service Authentication in .NET

I'm trying to build a .NET service application that would access Google's Prediction API.

This application is a service (no user interaction) so I'd like to know how it would be possible to authenticate to Google API automatically (without having it open a browser in which to log in and then press "Authorize").

What I've tried:

At this point I hope I'll be able to get the python sample going and either re-write it in .NET or use it with Iron Python.

I'm interested if anyone had this kind of problem before and what was the resolution. I'm also open to non-OAuth2 (and probably deprecated) authentication solutions if OAuth2 Service Authentication isn't possible (for now) in .NET.

Upvotes: 1

Views: 833

Answers (1)

Marc Cohen
Marc Cohen

Reputation: 3808

I've written a sample app (in Python & Java, sorry not available in C#) which authenticates once, stores the OAuth credentials and related data on the server (Google App Engine) and from that point forward reuses those shared credentials, refreshing the access token when needed, without requiring end users to see the OAuth allow/deny dialog, or any other aspect of OAuth.

This still requires the application administrator to execute the OAuth dialog but that's a one-time event. If for some reason you want to reset the stored server credentials, the initialization step can be re-executed on demand via a special URL, however, this reset function is protected so that only the application administrator can make that request, not an end user.

Upvotes: 1

Related Questions