This project has moved and is read-only. For the latest updates, please go here.

Authorize always asks for rights permissions

Nov 27, 2013 at 3:12 AM
Love LinkToTwitter. Have been using it for a while for Twitter related API calls, and have the auth flow working fine for that scenario.

What I would like to do is create a simple "log in with twitter' button. We already have all their credentials.

I have it working, however every time the user is asked to re-authorize the application. I'd simply like Twitter to authenticate the user and pass back their Twitter credentials (assuming the user has already authorized the app).

I'm sure I'm missing something really basic, but how?
IOAuthCredentials credentials = new SessionStateCredentials();

                if (credentials.ConsumerKey == null || credentials.ConsumerSecret == null)
                    credentials.ConsumerKey = this.twitterConsumerKey;
                    credentials.ConsumerSecret = this.twitterConsumerSecret;
                var auth = new MvcAuthorizer
                    Credentials = credentials,

                if (string.IsNullOrWhiteSpace(credentials.ConsumerKey) ||
                    return RedirectToAction("Error");


               //check for our user details using auth.UserId and log them in
Nov 27, 2013 at 4:04 AM

You could try the SignInAuthorizer. There's a demo in the downloadable source code, in the WebFormsDemo project.

@JoeMayo on Twitter
Nov 27, 2013 at 7:34 PM
Thanks Joe,

The SignInAuthorizer didn't work for me (kept getting a null reference exception), however upon looking at the source it seemed that the equivalent would just be to use the regular MvcAuthorizer and set:

auth.OAuthAuthorizeUrl = "";

That worked a treat.


Nov 27, 2013 at 7:36 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Nov 27, 2013 at 7:40 PM

Thanks for the follow-up. Looks like I can use that to build an MvcSignInAuthorizer.