Bug 37261 - Getting 401 error after successfully connecting to Twitter.
Summary: Getting 401 error after successfully connecting to Twitter.
Status: NEW
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: N/A
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Miljenko Cvjetko Mel
URL:
Depends on:
Blocks:
 
Reported: 2015-12-23 10:20 UTC by Jakub Holovsky
Modified: 2017-06-28 10:06 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 37261 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Jakub Holovsky 2015-12-23 10:20:49 UTC
Currently we are using Xamarin.Auth to connect to Twitter.

var authenticator = new OAuth1Authenticator(Platform.TwitterConsumerKey, Platform.TwitterConsumerSecret,
                new Uri("https://api.twitter.com/oauth/request_token"),
                new Uri("https://api.twitter.com/oauth/authorize"),
                new Uri("https://api.twitter.com/oauth/access_token"), new Uri("https://mobile.twitter.com/"));
            authenticator.Error += onAuthenticatorError;
            authenticator.Completed += onAuthenticatorCompleted;

The Authentication succeeds and onAuthenticatorCompleted is called which is all good.
The problem is that right after that onAuthenticatorError is called even though I can successfully communicate with Twitter without any problems. I am wondering why that is happening.

The exception that I can view onAuthenticatorError is following:

"The remote server returned an error: (401) Authorization Required."

I am not sure if this is a bug in Xamarin.Auth or related to code in our project. Another developer has the same issue as posted in here:

http://forums.xamarin.com/discussion/58099/getting-401-error-after-successfully-connecting-to-twitter
Comment 1 Miljenko Cvjetko Mel 2016-01-05 23:32:26 UTC
Ahoj Jakub

I do maintain Xamarin.Auth my fork and samples are here:

https://github.com/moljac/Xamarin.Auth/tree/portable-bait-and-switch

I have tried to make my samples descriptive as much as posible. I have
even added markdown property which should explain how to setup server:

https://github.com/moljac/Xamarin.Auth/blob/portable-bait-and-switch/samples/Xamarin.Auth.Sample.Data/SampleData/Providers/TwitterOAuth1.cs

Currently we have problems with iOS and savinf AccountStore and as soon as we solve that we'll proceed with publishing nugets and component.

https://github.com/moljac/Xamarin.Auth/blob/portable-bait-and-switch/samples/Traditional.Standard/references01projects/Xamarin.Auth.Sample.XamarinIOS/TestProvidersCell.cs#L182

best regards

Mel
Comment 2 Adam Hartley [MSFT] 2017-06-28 10:06:17 UTC
Reassigning this to Components as it appears to be an issue with Xamarin.Auth rather than Xamarin.Android