asp.net mvc 4 - Oauth with Box SDK (C# MVC .NET) -
i trying build login mvc web app, using box sdk .net. cannot life of me wrap head around oauth login process though. feel have down close, actual post action confusing me.
here process trying follow: https://developers.box.com/oauth/ i'm getting stuck on "the first leg" part.
i pass in uri , data attributes post intended
var data = new list<keyvaluepair<string, string>> { new keyvaluepair<string, string>("response_type", "code"), new keyvaluepair<string, string>("client_id", client_id), new keyvaluepair<string, string>("box_login", account_email) }; httpresponsemessage values = await post("https://app.box.com/api/oauth2/authorize", data);
with custom post() method wrapper:
public static async task<httpresponsemessage> post(string uri, list<keyvaluepair<string, string>> pairs) { using (httpclient client = new httpclient()) { var content = new formurlencodedcontent(pairs); var response = await client.postasync(uri, content); return response; } }
but "values" contents come html box authorization page. assumedly i'm supposed redirect page... don't know best approach (and return).
i feel boils down misunderstanding of how post works. obvious , simple thing missing?
Comments
Post a Comment