2

So I am trying to authenticate some user on twitter api using LinqToTwitter.

public class PinAuthorizer : AuthorizerBase, IAuthorizer
{
        public PinAuthorizer();
        public PinAuthorizer(bool forceLogin);
        public PinAuthorizer(bool forceLogin, AuthAccessType accessType);
        public PinAuthorizer(bool forceLogin, AuthAccessType accessType, string preFillScreenName);

        public Func<string> GetPin { get; set; }
        public Action<string> GoToTwitterAuthorization { get; set; }
        public Task CompleteAuthorizeAsync(string pin);
}

The problem is I dont know how to work with this delegate. I'm trying:

 Authorizer = new PinAuthorizer {
                            CredentialStore = new InMemoryCredentialStore {
                                    ConsumerKey = ConsumerKey,
                                    ConsumerSecret = ConsumerSecret,
                                    ScreenName = Name
                            }
                    };
 WebBrowserControl.Navigate(Authorizer.GoToTwitterAuthorization);

I get null reference exception.

UPDATE: I'am not trying to understand why the null reference happens. I'm trying to understand how can I correctly use the delegate so I can go to the authorization url with my WebBrowser control. Please read the question before marking it as duplicate.

0 Answers0