nxtbgthng / OAuth2Client

Client library for OAuth2 (currently built against draft 10 of the OAuth2 spec)
855 stars 217 forks source link

Invalid Request Token: Simple twitter-Oauth test does not work. #107

Open inkrement opened 10 years ago

inkrement commented 10 years ago

I don't know if it's a bug or I did something wrong. I tried to receive a access_token from twitter. To keep it simple I wrote all strings/password directly into the code (But I censored some strings with "placeholder" (for obvious security reasons)).

I added the following to my AppDeligate.m:

+ (void)initialize {
    [[NXOAuth2AccountStore sharedStore] setClientID:@"placeholder"
        secret:@"placeholder"
        authorizationURL:[NSURL URLWithString:@"https://api.twitter.com/oauth/authorize"]
        tokenURL:[NSURL URLWithString:@"https://api.twitter.com/oauth/access_token"]
        redirectURL:[NSURL URLWithString:@"myapp://twitter-callback"]
        forAccountType:@"Twitter"];
}

.. and a Button with the following action to my ViewController.m:

- (IBAction)TwitterLogin:(id)sender {

    [[NXOAuth2AccountStore sharedStore]
        requestAccessToAccountWithType:@"Twitter"
        username:@"placeholder"
        password:@"placeholder"];
}

But I receive the following Error:

2014-02-23 11:43:28.104 BRO[11604:70b] oauthConnection Error: Invalid request token

vintagexav commented 10 years ago

Did you find the answer tot his?