1

Using following code to get OAuth token but it always fails with error

Your credentials do not allow access to this resource

I have taken following code sample from
https://github.com/nst/STTwitter/blob/master/demo_cli/reverse_auth/main.m

Even I have allowed Read and Write access in application settings at https://apps.twitter.com/app/XXXX/permissions
enter image description here

STTwitterAPI *twitter = [STTwitterAPI twitterAPIWithOAuthConsumerName:nil consumerKey:@"MY CONSUMER KEY" consumerSecret:@"MY CONSUMER SECRET"];
    [twitter postReverseOAuthTokenRequest:^(NSString *authenticationHeader) {

        STTwitterAPI *twitterAPIOS = [STTwitterAPI twitterAPIOSWithFirstAccount];
        [twitterAPIOS verifyCredentialsWithSuccessBlock:^(NSString *username) {

            [twitterAPIOS postReverseAuthAccessTokenWithAuthenticationHeader:authenticationHeader successBlock:^(NSString *oAuthToken, NSString *oAuthTokenSecret, NSString *userID, NSString *screenName) {

                NSLog(@"REVERSE AUTH OK");


            } errorBlock:^(NSError *error) {

                NSLog(@"ERROR, %@", [error localizedDescription]);
            }];

        } errorBlock:^(NSError *error) {
            NSLog(@"ERROR");
        }];

    } errorBlock:^(NSError *error) {
        NSLog(@"ERROR");
    }];

Any help, where I am going wrong.

Aamir
  • 16,329
  • 10
  • 59
  • 65

0 Answers0