Search code examples
oauthtwitterxcode3.2http-status-code-401mgtwitterengine

mgtwitterengine and oauth 401 error: Boggled


OK... so here is my code:

twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];    
    [twitterEngine setConsumerKey:CONSUMER_KEY secret:CONSUMER_SECRET];
    accessToken = [twitterEngine getXAuthAccessTokenForUsername:profile.twitterUserId password:profile.twitterPassword];
    NSLog(@"Access token: %@", accessToken);

the console shows the access token returned just fine (so it seems to work) eg. Access token: C8A24515-0F11-4B5A-8813-XXXXXXXXXXXXXX

but instead of accessTokenReceived method being called next on my delegate, it calls requestFailed with a 401. How can I be getting a 401 unauthorized and getting an access token back from the method call?????


Solution

  • Found the issue... for anyone else that has this problem... Getting your app approved for OAuth is only part of the process. Although it looks like you are done and the twitter page gives you your key and secret... there is one not-quite-so-easy-to-find next step. You must send an email to [email protected] and ask them to actually enable it.

    That was fun figuring out. :)