auth.BeginAuthorization() in Twitter API V 1.1

Apr 12, 2013 at 12:24 PM
auth object is populated with consumerkey and consumersecret. But when I call auth.BeginAuthorization(Call_Back_URL);
I get 401 unauthorized error. I have checked application keys. They are correcta dn were working when I was using LinqtoTwitter for twitter api version 1.0. This problem has started to occur after I swtiched to LinqToTwitter for twitter api V 1.1
Coordinator
Apr 13, 2013 at 4:21 AM
Hi,

I just updated the LinqToTwitterMvcDemo project and checked it in. It isn't attached to the solution, but you can find the folder. It's essentially the same as the old version, except I upgraded it to MVC 4. You might want to try to get that running (as a minimal implementation) to work out any issues.

Also, I have a 401 FAQ that might help.

@JoeMayo
Apr 13, 2013 at 11:42 AM
I using Web Forms. So Is there a solution for web forms?
Sent from Windows Mail
From: JoeMayo
Sent: ‎Saturday‎, ‎13‎ ‎April‎ ‎2013 ‎08‎:‎51
To: [email removed]

From: JoeMayo

Hi,

I just updated the LinqToTwitterMvcDemo project and checked it in. It isn't attached to the solution, but you can find the folder. It's essentially the same as the old version, except I upgraded it to MVC 4. You might want to try to get that running (as a minimal implementation) to work out any issues.

Also, I have a 401 FAQ that might help.

@JoeMayo
Coordinator
Apr 13, 2013 at 9:16 PM
Yes, it's in the same folder, LinqToTwitterWebFormsDemo. Make sure you've upgraded LinqToTwitter to the latest version because Twitter did change their OAuth processing recently.

@JoeMayo
Apr 15, 2013 at 4:54 AM
Thanks Joe. I will check it out.


Apr 15, 2013 at 12:41 PM
I checked it. I have the lates version of LinqToTwitter. I am passing the correct consumer key and secret. Its failing at auth.BeginAuthorization(). Instead of redirecting to Twitter authentication page(wher I enter User Name and Password), it is generating a 401 exception.


Apr 15, 2013 at 1:25 PM
Here is the response header from twitter

{content-encoding: gzip
pragma: no-cache
Content-Length: 158
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Type: text/html; charset=utf-8
Date: Mon, 15 Apr 2013 12:21:53 GMT
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Last-Modified: Mon, 15 Apr 2013 12:21:53 GMT
Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCM%252FxpA0%252BASIKZmxhc2hJQzonQWN0aW9uQ29u%250AdHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoHaWQiJWY3%250AMDE3NjlkMzYzZjcyMDZjMDc3YjgwYTk2ZmVjZGE0--01905ab3a76a9c0d0db4ca2dc35d42a686275880; domain=.twitter.com; path=/; HttpOnly,guest_id=v1%3A136602851373099361; Domain=.twitter.com; Path=/; Expires=Wed, 15-Apr-2015 12:21:53 UTC
Server: tfe
status: 401 Unauthorized
strict-transport-security: max-age=631138519
vary: Accept-Encoding
www-authenticate: OAuth realm="https://api.twitter.com"
x-frame-options: SAMEORIGIN
x-mid: e70c369a1a6573fca6dec1b9e20c1ee4da78f4de
x-transaction: 9aa12d2f7c59ddc8
x-xss-protection: 1; mode=block

}


Coordinator
Apr 16, 2013 at 4:37 AM
Could you comment out UseCompression in your authorizer and see if you see this in Fiddler on the /oauth/authorize response:
_403 Forbidden: The server understood the request, but is refusing to fulfill it._
It seems like others are having the same problem:

https://dev.twitter.com/discussions/10889

It was working for me yesterday, but I'm seeing the 403 today.

@JoeMayo
Apr 16, 2013 at 9:18 AM
Thanks for the update on issue Joe. Its good to know there are others facing the same problem.


Coordinator
Apr 20, 2013 at 5:42 AM
Try to go to Twitter as yourself and explicitly sign out. Then try to authenticate through your app again. The error I'm seeing, 403, only occurs if you're logged in and have checked the Remember me box and then try to do OAuth.

@JoeMayo
Apr 22, 2013 at 7:00 AM
I tried. Its not working. And the error I am getting is 401 unauthorized.