Search code examples
twitterproxytwitter-oauthtweetinvi

Tweetinvi AuthFlow.InitAuthentication - how to set ProxyURL


I am having trouble at this line -

var authenticationContext = AuthFlow.InitAuthentication(applicationCredentials, callBackURL);

From our app servers internet calls are restricted. After setting a proxy url, I can browse twitter website on IE browser.

Now the puzzle is how to set the proxy to succeed the above code snippet in TweetInvi object. I tried setting a valid proxy using this property -

TweetinviConfig.ApplicationSettings.ProxyURL

But, still I get Timedout error. Is there a way to set the proxy url to make calls to Twitter success?

exception Message: https://api.twitter.com/oauth/request_token web request timed out.

Web exception Stack trace:

at Tweetinvi.Credentials.WebTokenFactory.LogExceptionOrThrow(TwitterException ex) at Tweetinvi.Credentials.WebTokenFactory.InitAuthenticationProcess(IConsumerCredentials appCredentials, String callbackURL, Boolean updateQueryIsAuthorized) at Thomson.Financial.Thomlets.Economics.Web.PublishTwitter.GetAutherizeFromTwitter()


Solution

  • ProxyURL propoerty did not work. I made changes to Web.config of the actual application to use the proxy. Make the below changes to web.config so that the servers can access the internet -

    <defaultProxy useDefaultCredentials="false">
        <proxy usesystemdefault="true" proxyaddress="<proxy address>" bypassonlocal="true" />
    </defaultProxy>