parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

login with twitter error in PFLoginViewController

Open kenjiIdo opened this issue 10 years ago • 25 comments

Hi, I can't login with twitter with using ParseTwitterUtils. {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.12.0)

typed in AppDelegate.m [PFTwitterUtils initializeWithConsumerKey:@"xxxxxxxxxxxxxxxxxxxxx" consumerSecret:@"xxxxxxxxxxxxxxxxxxxxx"];

then PFLogInViewController *logInController = [[DFParseLogInViewController alloc] init]; logInController.fields = PFLogInFieldsDefault | PFLogInFieldsFacebook | PFLogInFieldsTwitter; logInController.delegate= self;

i got the below message: "Login failed" {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.12.0)

but it's ok when i use fabric & twitterkit sdk.

please help me.

kenjiIdo avatar Mar 11 '16 09:03 kenjiIdo

Can you provide the server logs when running with VERBOSE=1?

flovilmart avatar Mar 11 '16 14:03 flovilmart

a

kenjiIdo avatar Mar 11 '16 15:03 kenjiIdo

Did you set your twitter configuration correctly? 

oauth: {    twitter:  {       consumer_key: «  »,       consumer_secret: «  »    } }

flovilmart avatar Mar 11 '16 15:03 flovilmart

uh sorry. where i set oauth?

kenjiIdo avatar Mar 11 '16 15:03 kenjiIdo

where i configure this info? oauth: { twitter: { consumer_key: « », consumer_secret: « » } }

kenjiIdo avatar Mar 11 '16 15:03 kenjiIdo

ahah! when you start your ParseServer. For now we don't rely on the keys and secret passed by the client to ensure your user has a valid login.

flovilmart avatar Mar 11 '16 15:03 flovilmart

I declared in Appdelegate.m file [PFTwitterUtils initializeWithConsumerKey:@"EkubAxxxxxxGJApPD" consumerSecret:@"meqxxxxblCOwma"];

kenjiIdo avatar Mar 11 '16 15:03 kenjiIdo

You need to configure it in parse-server https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#oauth

flovilmart avatar Mar 11 '16 15:03 flovilmart

please explain...

kenjiIdo avatar Mar 11 '16 15:03 kenjiIdo

Did you read the documentation relative to OAuth on parse-server that I just posted?

flovilmart avatar Mar 11 '16 15:03 flovilmart

Thank you very much, just done.

kenjiIdo avatar Mar 11 '16 16:03 kenjiIdo

@flovilmart I'm using parse server version 2.2.25 at both local and remote server. I have configured twitter login at index.js and using loginWith() to login. It works locally but not with remote server. I'm using AWS Elastic Beans for remote server. FYI, Facebook and Google login work remotely with the loginWith() function. Here's sample request for twitter ...

{
"authData":{
"twitter":{
"id":14303772,
"screen_name":"junal",
"consumer_key":"-----",
"consumer_secret":"---",
"auth_token":"14303772-----",
"auth_token_secret":"---"
}
},
"_ApplicationId":"---",
"_ClientVersion":"js1.9.2",
"_InstallationId":"c24a0cca-------"
}

Here's what I get. Any advice?

{
  "code": 1,
  "message": "Internal server error."
}

junal avatar Feb 26 '17 01:02 junal

Probably an issue with your deployment to elastic beanstalk, if it works locally.

flovilmart avatar Feb 26 '17 03:02 flovilmart

@flovilmart Upgrading my local parse-server to latest i.e 2.3.5 worked locally but when I update package.json file to update the same to remove server, it did but then it gave me 502 bad gateway error.

junal avatar Feb 27 '17 02:02 junal

Again, likely an issue with how you deploy to Elastic Beanstalk. Not sure how you're configured nor how you deploy.

flovilmart avatar Feb 27 '17 02:02 flovilmart

@flovilmart here's my configuration https://dl.dropboxusercontent.com/spa/e8jedo3lnl7g7wc/bckad01p.png and deploy using "eb deploy"

junal avatar Feb 27 '17 02:02 junal

From the docs: If git is installed, EB CLI uses the git archive command to create a .zip file from the contents of the most recent git commit command.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-deploy.html

Are all your changes correctly commited?

flovilmart avatar Feb 27 '17 03:02 flovilmart

Then perhaps the eb_*.logs that may give a pointer as for what went wrong in the deployment

flovilmart avatar Feb 27 '17 03:02 flovilmart

when ever try to login with twitter in parse the below error occuring

TwitterLoginWithParseExample[2581:116523] Error: Error Domain=com.parse.networking.error Code=-1011 "Expected status code in (200-299), got 410" UserInfo={NSLocalizedDescription=Expected status code in (200-299), got 410, NSErrorFailingURLKey=https://api.parse.com/2/user_signup_or_login} (Code: 100, Version: 1.2.19)

kukkadapukarhtik avatar Jun 02 '17 13:06 kukkadapukarhtik

Can you open the issue on the relevant repository? Seems that you're using an outdated SDK / example that has api.parse.com hardcodded (which is down at the moment)

flovilmart avatar Jul 23 '17 15:07 flovilmart