401 not authorized when requesting access token

Jun 8, 2012 at 1:39 PM

Hi there!

I have troubles getting access tokens. I tried using an asp sample app as well as building my own little app based on the OAuth documentation: http://linqtotwitter.codeplex.com/wikipage?title=Implementing%20OAuth%20for%20ASP.NET%20MVC&referringTitle=Learning%20to%20use%20OAuth

So I'm guessing it must be related to the app I created. In the documentation on configuring OAuth, I also found the following "I always set application type to Browser", however I nowhere see this option in Twitter.

Can anyone help? Please let me know if I need to provide more information.

Jun 8, 2012 at 2:09 PM

Using a console sample, it seems to work.

But still I have no idea what needs to be changed on my Twitter app to make it work with Linq2Twitter over web...

Jun 8, 2012 at 2:19 PM

Adding a callback URL will do the trick, even if it is overruled by the application...

Jun 8, 2012 at 2:51 PM

Hi Ron,

I'm planning on doing a 401 FAQ (currently on the Issues list) because there are multiple situations that cause a 401.  Besides credentials, there are other strange reasons like application configuration, setting the callback (as you saw), sequence of calls to OAuth, ensuring your machine clock time is accurate, and probably a few other things I haven't listed.

Glad you figured it out.


Jun 8, 2012 at 3:11 PM

Thanks for the quick reply Joe. Really like your library btw!

Jul 25, 2012 at 2:42 PM
Ron83 wrote:

Adding a callback URL will do the trick, even if it is overruled by the application...

Same experience for me.

Created a sample app @ http://dev.twitter.com/apps WITHOUT callback_url (leaved empty)

MVC samples broken but console samples running

Added a fake callback_url and MVC samples now are ok.