I'm brand new looking at oAuth stuff so forgive any stupid seeming questions.

I've been scouring the forums here and touched base with a couple of people and seem to have some basic code that would allow me to interact with Google Calendar.... except that it is all for WebApp and not for a Desktop app (which is my need).

As I am at the start of a steep learning curve, I thought that I would take it step by step and hopefully will slowly start to understand it as I start to build it.

My first hurdle seems a difficulty in getting back an Authorization Token

I've narrowed it down to a chunk of Javascript code which does this when using a webapp, but I am having trouble figuring out how to do this in a desktop app. I thought that perhaps it would be like a SOAP call (which I've done a bit of in the past)

The comments for the Javascript piece come from one of Mike Peat's examples:

Code:

This class handles the initial OAuth 2.0 (http://oauth.net - RFC: http://tools.ietf.org/html/rfc6749)
user login and initial consent grant. It opens a new browser window (users may need to turn off pop-up
blockers) with the vendor's OAuth 2.0 url, passing a number of parameters in the query string. It then
waits for the window to be redirected to the redirect url (generally an empty HTML page) and on detecting
that redirection (by examining the URL of the new windows in a timer loop) it parses the URL for data
embedded in the that. If no error is reported and an Authorisation code or access token is returned (and
also if the passed "state" - in this case just the VDF session cookie - is the same as the returned 
"state", to ensure against Cross Site Request Forgery attacks) it will trigger the "LoginDone"
server-side action (which in turn will fire the OnLogin event), otherwise it will trigger the "LoginFail"
server-side action (which in turn will fire the OnLoginFail event).


Most of the action is handled by the vendor's OAuth 2.0 mechanism - we just trigger it and deal with what
it sends us back.
So I guess I have 3 questions:

1. Has anybody done an oAuth login through a Desktop app? (if so, I'd love to know more)

2. Am I right in thinking that I should be able to get the oAuth Authorization Token using SOAP?

3. How would you replace the javascript in a desktop app.

As previously mentioned, some of these questions might seem stupid, but simply because I haven't quite come to understand how this works (yet)

TIA

Mike