jhoerr / box-csharp-sdk-v2

A C# client for the Box API (v2).
http://developers.box.com/docs/
11 stars 15 forks source link

Console or WinForms based OAuth2 example. #10

Closed mascon closed 11 years ago

mascon commented 11 years ago

Question

I just don't see how from a forms based application you could use the OAuth2 as it requires a redirect URL. This is easy within a webApp.

Any ideas how you would handle authorisation from a Console or WinForms based app?

Maybe a sample snippet would be good.

jhoerr commented 11 years ago

My understanding is that the only way to authenticate with Box is through their website. The redirect URL can have a custom scheme (e.g. myscheme://foo) which can be hooked by the client application. I haven't messed around with this, but Box provides some direction. That example is iOS-specific, but I think the idea is generally applicable.

mascon commented 11 years ago

OK I read it and I that is very iOS I can not find anything like that in .NET. Any ideas how to capture the redirect information would be a great help.

jhoerr commented 11 years ago

This StackOverflow question might get you pointed in the right direction.

mascon commented 11 years ago

Yep I looked at that one, but this just invokes an external application and not a hook into your running app.

jhoerr commented 11 years ago

Hrm.. I'm not altogether sure, then. Maybe the Box platform folks would have some advice?