OAuth 2.0 (Google API) authentication from a WPF desktop application

Martin picture Martin · May 5, 2012 · Viewed 8k times · Source

I would like to use OAuth 2.0 from within a WPF application I am developing but I am stuck. It appears that the OAuth 2.0 works by forwarding you to a website and getting you confirm details.

Of course this is a WPF app, and I wonder if there are any work-arounds.

Specifically I am trying to authenticate with OAuth 2.0 for use with the google latitude API located here

https://developers.google.com/latitude/v1/using#auth

Are there examples of how to authenticate against OAuth 2.0 from a WPF desktop app?

Answer

Claudio Cherubino picture Claudio Cherubino · May 5, 2012

There's a sample WPF application that uses the google-api-dotnet-client library in the project repository:

https://github.com/googleapis/google-api-dotnet-client

This sample app uses the Tasks API, but it should be pretty easy to adapt it to use the Latitude API instead.