c# - Pass in callback url when seeking request -


I'm adding Twitter integration to the web applications of my companies, but I'm blocking it.

This issue is currently with callback url.

In Twitter, it seems that it should be a fixed value, but the way our application is set up, every customer who arrives on that site has their own URL. / P>

Ideally I want to set the callback url on the fly, but I am having difficulty finding any information on it.

Edit: Think I may have to add something that has been given more detail here to help you better your help

The problem is that I set up the callback URL parameter But when I'm going to take permission, it will have to go to the callback setup on the API, which I have not set

  public string oAuthToken (string callback url) {Ury oauthUrl = new Uri ("https: // api .twitter.com / OAuth / request_token"); Var oauthNonce = Convert.ToBase64String (new ASCIIEncoding (). GetBytes (DateTime.Now.Ticks.ToString ())); Var oauthTimestamp = this.GenerateTimeStamp (); Var oauthSignature = ""; Var authSignature = String.Format ( "oauth_callback = \" {0} \ "& amp; oauth_consumer_key = \" {1} \ "& amp; oauth_nonce = \" {2} \ "& amp; oauth_signature_method = \" {3 } \ "& amp; Outh_timstmp = \" {4} \ "& amp; Outh_vrshn = \" {5} \ "", Uri.askpedtstring (Colbakurl), Uri.askpedtstring (Thiskkonsumerkey), Uri.askpedtstring (Outnonke ), Uri.EscapeDataString (oauthSignatureMethod), Uri.EscapeDataString (oauthTimestamp), Uri. EscapeDataString (oauthVersion)); Var baseString = string.Format ("POST and {0} and 1}", Uri.EscapeDataString (oauthUrl.AbsoluteUri), Uri.EscapeDataString (authSignature)); Var = String of Composite Konkat (Uri. Escapaditystring (This commerce secret), "& amp;"); Using (HMACSHA1 hasher = new HMACSHA1 (Encoding.ASCII.GetBytes (compositeKey))) {oauthSignature = Convert.ToBase64String (hasher.ComputeHash (Encoding.ASCII.GetBytes (baseString))); } " Outh_signecr_methd = \ "{4} \", Outh_timstmp = \ "{5} \", Outh_vrshn = \ "{6} \" ", Uri.askpedtstring (Colbakurl), Uri.askpedtstring (Thiskkonsumerkey), Uri.askpedtstring (Outnonke), Uri.askpedtstring (Oothsigncr), Uri.askpedtstring (Oothsigncremethoda), Uri.askpedtstring (Outtimstmp), Uri.askpedtstring (Oauthversion)); ServicePointManager.Expect100Continue = false; HttpWebRequest authRequest = (HttpWebRequest) System.Net.WebRequest.Create (oauthUrl); AuthRequest.method = "post"; AuthRequest.Headers.Add ("authorization", authHeader); AuthRequest.Headers.Add ("accept-encoding", "gzip"); AuthRequest.ContentType = "application / x-www-form-url; charset = UTF-8"; AuthRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; try using {(var response = authRequest.GetResponse () HttpWebResponse as) {if (response.StatusCode = HttpStatusCode.OK!) {new Exception (String.Format ( "server error (throw HTTP {0}: { 1}). ", Response status code, response status description); } Var stream = response.GetResponseStream (); Var sr = new streamrider (stream); Return sr.ReadToEnd (); }} (Pre reader = new streamminder (stream)) using ({var reader = ex.Response.GetResponseStream ()) hold (pre-WebExation). Read and (); }}}   

I always get a 401 error.

The callback URL requires an app set-up, while the OAuth 1.0A space is ordered The callback URL is passed with the request token. You can pass any valid URL along with that request, effectively you can visit each of your callbacks unique URL for each of your users. Therefore, you are not locked into the callback URL in the set-up of your application.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -