title: Login with twitter to get user profile asp.net
body: <p>I have a web application in asp.net . I want to use login with twiiter to get get user info. I have followed all instructions mentioned in below article</p>
  
  <p><a href="http://www.aspsnippets.com/Articles/Login-with-Twitter-in-ASPNet-using-Twitter-Button.aspx" rel="nofollow">http://www.aspsnippets.com/Articles/Login-with-Twitter-in-ASPNet-using-Twitter-Button.aspx</a></p>
  
  <p>I am getting redirected to twitter app then after authentication I am being redirected to my localhost app. Then I have check user is authorized but when I try to get user details by method <strong>FetchProfile()</strong> I am getting error.</p>
  
  <p>My code is as below :</p>
  
  <p>First on button click</p>
  
  <pre><code>protected void LoginTwitter(object sender, EventArgs e)
  {
  
      if (!TwitterConnect.IsAuthorized)
      {
          TwitterConnect twitter = new TwitterConnect();
          twitter.Authorize(Request.Url.AbsoluteUri.Split('?')[0]);
      }
  
  }
  </code></pre>
  
  <p>then after authenticating back from twitter . on page load of application
  I have check url its </p>
  
  <pre><code>http://localhost:63977/Account/Login?oauth_token=K0mECAAAAAAAxRXEAAABV44xPgc&amp;oauth_verifier=qYLFiOlFPx4gxEu6V4AmTJG2JNjJ3nV2
  </code></pre>
  
  <p>then code to check </p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      TwitterConnect.API_Key = HelperClasses.TwitterApiKey;
      TwitterConnect.API_Secret = HelperClasses.TwitterApiSecret;
  
      if (Request.QueryString["oauth_token"] != null)
      {
          //twiiter
          if (TwitterConnect.IsAuthorized)
          {
              TwitterConnect twitter = new TwitterConnect();
              //LoggedIn User Twitter Profile Details
              DataTable twitterUserDataTable = twitter.FetchProfile(); // error here
          }
      }
  }
  </code></pre>