2

Closed

Win8 -Metro app - Authorize

description

I think I see what's happening. Make sure LocalDataCredentials is instantiated with the correct values before assigning to Credentials property of the PinAuthorizer. Something like this:



auth =
 new PinAuthorizer
 {
    Credentials = new LocalDataCredentials
    {
         ConsumerKey = "consumerKey",
         ConsumerSecret = "consumerSecret"
    }
 };



I still have a sequencing bug where the credentials don't get passed to dependent objects if you change them after the Authorizer is constructed. Here's my blog post on one way to do this in Windows 8:

http://geekswithblogs.net/WinAZ/archive/2012/07/02/using-linq-to-twitter-oauth-with-windows-8.aspx

BTW, my latest bit of code includes a WinRtAuthorizer. I haven't documented or blogged about it yet, but it's very nice.

Joe
Closed Jan 19, 2013 at 11:40 PM by JoeMayo

comments

Balrog_eg wrote Sep 22, 2012 at 10:12 PM

I can't describe how i am appreciated with your support. it work with the below code as you guided me.


if (cred.AccessToken != null && cred.OAuthToken != null)
            {
                auth =
                    new PinAuthorizer
                    {
                        Credentials = new LocalDataCredentials { 
                            ConsumerKey = "mykey",
                            ConsumerSecret = "mysecret",
                            OAuthToken =cred.OAuthToken ,
                            AccessToken = cred.AccessToken
                        }
                    };
                auth.Authorize();

            }

Thanks very much.

JoeMayo wrote Nov 25, 2012 at 3:04 AM

The preferred way to authenticate in WinRT is via the WinRTAuthorizer.