Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth - XAuth Login does not work #18

Closed
teofiloisrael opened this issue Jul 4, 2013 · 6 comments
Closed

OAuth - XAuth Login does not work #18

teofiloisrael opened this issue Jul 4, 2013 · 6 comments
Assignees

Comments

@teofiloisrael
Copy link

In Mac demo project, if I try to login with user name and password, I receive the following error:

The operation couldn’t be completed. (STHTTPRequest error 401.)

@ghost ghost assigned nst Jul 4, 2013
@nst
Copy link
Owner

nst commented Jul 4, 2013

I cannot reproduce the issue. XAuth login works for me at least this way:

STTwitterAPIWrapper *twitter =
[STTwitterAPIWrapper twitterAPIWithOAuthConsumerName:@""
                                         consumerKey:@""
                                      consumerSecret:@""
                                            username:@""
                                            password:@""];

[twitter verifyCredentialsWithSuccessBlock:^(NSString *userName) {
    NSLog(@"-- userName: %@", userName);
} errorBlock:^(NSError *error) {
}];

Please double-check your OAuth tokens and Twitter credentials, and post sample code if the problem persists.

@teofiloisrael
Copy link
Author

After fix the tokens got another error. Still not able to indentify the line of the problem. I'm only testing the sample project for mac.

NSURLErrorDomain error -1012 - STTwitter[93615:303] Unhandled authentication challenge type - NSURLAuthenticationMethodOAuth2

image

@nst
Copy link
Owner

nst commented Jul 5, 2013

XAuth authentication in the sample project works for me.

NSURLErrorDomain -1012 is an authentication issue.

Are you using a proxy server or something?

@teofiloisrael
Copy link
Author

I do not use proxy and I'm on Mac OS X 10.8.3

@byteslick
Copy link

Same issue for me too...
Unhandled authentication challenge type - NSURLAuthenticationMethodOAuth2
2013-07-10 01:39:46.956 MyDemo[56446:c07] Error: Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0xb04fc90 {NSErrorFailingURLKey=https://api.twitter.com/oauth/access_token, NSErrorFailingURLStringKey=https://api.twitter.com/oauth/access_token}

I am using IOS sample. Please dont say its working for you in your demo project.

@nst
Copy link
Owner

nst commented Jul 10, 2013

I was able to reproduce the issue by using consumer tokens that are not "xAuth-enabled".

Hence, I think both of you are using consumer tokens that are not "xAuth-enabled".

In order to use the xAuth authentication process (and bypass the PIN step), Twitter requires consumer tokens to be "xAuth-enabled".

You can read more on this on Twitter website https://dev.twitter.com/docs/oauth/xauth and contact Twitter to have your custom tokens enabled for the xAuth authentication process.

Thank you for taking the time to report the issue.

I will add something about that in the project's README.

@nst nst closed this as completed Jul 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants