1

Closed

Loading local credentials error (version 2.1.0.1) WinRt

description

This code from example work fine with version of linq to twittee it referenced to (version 2.0.8)



PinAuthorizer auth =
            new PinAuthorizer
            {
                Credentials = new LocalDataCredentials()
            };

        if (auth == null || !auth.IsAuthorized)
        {
            Frame.Navigate(typeof(OAuthPage));
            return;
        }

        var twitterCtx = new TwitterContext(auth);

        var timelineResponse =
                (from tweet in twitterCtx.Status
                 where tweet.Type == StatusType.Home
                 select tweet)
                .ToList();
But if I use version 2.1.0.1 I have async loading my local credentials and I in runtime am getting into


"if (auth == null || !auth.IsAuthorized)"
before credentials loaded completely so auth is not authorized.
When I set breakpoint in debug everything works fine and auth - object has
completely loaded credentials (loading operation finishes in background because of time delay).

Can you help me how can I walk around this problem using version 2.1.0.1 in WinRT, thanks
Closed Jan 19, 2013 at 11:40 PM by JoeMayo

comments

ramezdebbas wrote Oct 22, 2012 at 6:06 PM

I got that problem too, so basically every time I load my app, it keeps asking the user to login.

Any solution for that .

Thanks,
Ramez

JoeMayo wrote Oct 28, 2012 at 12:33 AM

The work-around for this is to use WinRtAuthorizer. There's a project in the Samples page called MetroWinRtAuthorizer:

http://linqtotwitter.codeplex.com/wikipage?title=LINQ%20to%20Twitter%20Samples&referringTitle=Home

Joe