Corona Cloud Facebook Login Failing

I am trying to log into Corona Cloud using Facebook and ran into some issues. On a side note, I have had success with logging in/signing up into corona cloud via email.

One thing I found that is not documented yet, is that you need to request the “email” permission or you’ll get an error when you use the authToken with corona cloud saying that you need a token with the email permission.

So first I do:

[lua]facebook.login( “XXXXXX”, listenerFunction, {“publish_stream”,“email”} )[/lua]

And in the listenerFunction, I save the event.token that comes when event.type == “session” and event.phase == “login”

And I retrieve some user info:

[lua]facebook.request( “me?fields=id,name,username,gender,timezone,picture” )[/lua]

I use the “id” I get from that request,along with the token to log into coronaCloud.

[lua]coronaCloud.loginFacebook( id, token )[/lua]

The “loginSuccess” successfully fires, and I see that coronaCloud now has an authToken of its own.

So all that seems to work. Now, here is the problem. When I try coronaCloud.getMyProfile(), I get an error.

In the event handler for “MyProfile”, event.results.error = “User authentication token is invalid”

And that is where I am stuck. The error message seems to suggest I received a bad auth token from corona cloud? But the login was successful?

one further detail, I am trying to do this with a new user. Maybe that is the issue?

Since I didn’t see any other cloud facebook apis, I am assuming the corona.loginFacebook() will either add the new user if the user does not exist or login the user if he/she already exists. Is that incorrect?

Or is the user supposed to register with their email,username,password first? Then they have to log into facebook and I then update their profile with the facebook info? Then the facebook login works?

Hi,

It would seem you are doing everything correctly, can you please PM me your Facebook ID and Access Token and I will check it on my end.

Thanks

-Mohamed

one further detail, I am trying to do this with a new user. Maybe that is the issue?

Since I didn’t see any other cloud facebook apis, I am assuming the corona.loginFacebook() will either add the new user if the user does not exist or login the user if he/she already exists. Is that incorrect?

Or is the user supposed to register with their email,username,password first? Then they have to log into facebook and I then update their profile with the facebook info? Then the facebook login works?

Hi,

It would seem you are doing everything correctly, can you please PM me your Facebook ID and Access Token and I will check it on my end.

Thanks

-Mohamed

Any update on the FB issue guys, just interested :wink:

Qwertier

Hi,

The issue is currently we don’t link Corona Cloud users with Facebook accounts.

So the problem that most people are facing is this.

  • They first create a Corona Cloud user with email: abc@abc.com
  • Then they create a Facebook login using an account that also has email abc@abc.com

This conflict causes the problem.

If you are in this please email me mohamed(at)coronalabs.com with the email accounts and I will delete them from our system. Then you can just login with FB and things will be ok.

Thanks

-Mohamed

Is there going to be a coding solution to solve this issue? We can’t be emailing you the email accounts for all of these situations. This conflict should be handled in the cloud or at least something for than this.

@sk studios lip, in most cases your end user is going to do one or the other, not both.  This tends to impact developers more since they want to test both methods of login and it’s too easy to use the same accounts.  

Any update on the FB issue guys, just interested :wink:

Qwertier

Hi,

The issue is currently we don’t link Corona Cloud users with Facebook accounts.

So the problem that most people are facing is this.

  • They first create a Corona Cloud user with email: abc@abc.com
  • Then they create a Facebook login using an account that also has email abc@abc.com

This conflict causes the problem.

If you are in this please email me mohamed(at)coronalabs.com with the email accounts and I will delete them from our system. Then you can just login with FB and things will be ok.

Thanks

-Mohamed

Is there going to be a coding solution to solve this issue? We can’t be emailing you the email accounts for all of these situations. This conflict should be handled in the cloud or at least something for than this.

@sk studios lip, in most cases your end user is going to do one or the other, not both.  This tends to impact developers more since they want to test both methods of login and it’s too easy to use the same accounts.  

hey screaming leaf, did they solve that problem?

do I need to require the facebook library to get the facebook token?

I am trying to log into Corona Cloud using Facebook and ran into some issues. On a side note, I have had success with logging in/signing up into corona cloud via email.

One thing I found that is not documented yet, is that you need to request the “email” permission or you’ll get an error when you use the authToken with corona cloud saying that you need a token with the email permission.

So first I do:

[lua]facebook.login( “XXXXXX”, listenerFunction, {“publish_stream”,“email”} )[/lua]

And in the listenerFunction, I save the event.token that comes when event.type == “session” and event.phase == “login”

And I retrieve some user info:

[lua]facebook.request( “me?fields=id,name,username,gender,timezone,picture” )[/lua]

I use the “id” I get from that request,along with the token to log into coronaCloud.

[lua]coronaCloud.loginFacebook( id, token )[/lua]

The “loginSuccess” successfully fires, and I see that coronaCloud now has an authToken of its own.

So all that seems to work. Now, here is the problem. When I try coronaCloud.getMyProfile(), I get an error.

In the event handler for “MyProfile”, event.results.error = “User authentication token is invalid”

And that is where I am stuck. The error message seems to suggest I received a bad auth token from corona cloud? But the login was successful?

Hi Screaming Leaf,

This was happening to me too, I could see that I was getting the right tokens to login, but it wasn’t logging in. As a quick fix, I realised when I was trying to login with facebook the first time I call coronaCloud.loginFacebook( id, token ) was not successful, so I call it again after I have got the tokens, which seems to work.

@

Yes you need to require facebook to get the facebook token.

thanks Gooner. I have facebook running now.

another question: I have a user registered by email. and now he wants to add his facebook friends. how does corona cloud solve that? do I need to update the user profile with the facebook id?

hey screaming leaf, did they solve that problem?

do I need to require the facebook library to get the facebook token?

I am trying to log into Corona Cloud using Facebook and ran into some issues. On a side note, I have had success with logging in/signing up into corona cloud via email.

One thing I found that is not documented yet, is that you need to request the “email” permission or you’ll get an error when you use the authToken with corona cloud saying that you need a token with the email permission.

So first I do:

[lua]facebook.login( “XXXXXX”, listenerFunction, {“publish_stream”,“email”} )[/lua]

And in the listenerFunction, I save the event.token that comes when event.type == “session” and event.phase == “login”

And I retrieve some user info:

[lua]facebook.request( “me?fields=id,name,username,gender,timezone,picture” )[/lua]

I use the “id” I get from that request,along with the token to log into coronaCloud.

[lua]coronaCloud.loginFacebook( id, token )[/lua]

The “loginSuccess” successfully fires, and I see that coronaCloud now has an authToken of its own.

So all that seems to work. Now, here is the problem. When I try coronaCloud.getMyProfile(), I get an error.

In the event handler for “MyProfile”, event.results.error = “User authentication token is invalid”

And that is where I am stuck. The error message seems to suggest I received a bad auth token from corona cloud? But the login was successful?

Hi Screaming Leaf,

This was happening to me too, I could see that I was getting the right tokens to login, but it wasn’t logging in. As a quick fix, I realised when I was trying to login with facebook the first time I call coronaCloud.loginFacebook( id, token ) was not successful, so I call it again after I have got the tokens, which seems to work.

@

Yes you need to require facebook to get the facebook token.