Facebook Login Does Not Return Token After Previous Login Was Cancelled

Hi,

I’m testing this on iPad.

I’ve tried to login to facebook and hit cancel.

The next time I’ve tried to login, the login method does not open any facebook login prompt, it only returns success without token.

I’m not sure what to do in such situation.

The only way I can get fb back to work is to restart the app.

Thanks,

Krystian

I have the same issue. Tested on various iOS devices and os versions. 

Try to login to Facebook and hit cancel in safari. (event.type will be session, event.phase = loginFailed)

Following login attempts do nothing, but event.type = session and event.phase = login. 

I’ve reported this under 

Case 23018

I have the same issue. Tested on various iOS devices and os versions. 

Try to login to Facebook and hit cancel in safari. (event.type will be session, event.phase = loginFailed)

Following login attempts do nothing, but event.type = session and event.phase = login. 

I’ve reported this under 

Case 23018

hi Krystian,

i’m working on a project and have run into the same issue. i’ve been looking around for a way to view the status of this bug, but can’t find anything.

when you filed that bug, did you get a URL too ?

thanks,
David

Hi David,

no I did not, I was never able to follow any of the bugs I submit.

Krystian

Hi all,

I’ve tried this on both my iPad (using the Facebook app for login) and iPhone 4 (using Safari for login), and I’m not having any issues.  At the Facebook app authorization screen, if I click cancel, I receive the loginCancelled event.  If I then try to login again, it goes through successfully, including receiving the login event and the access token.

When I receive a loginCancelled or loginFailed event, I call facebook.logout().  That might be why it’s working for me.  I’d be curious if that resolves the issue you’re all experiencing.

  • Andrew

Andrew, you are correct.

Calling facebook.logout() after failed facebook.login() allowed me to retry the login phase.

This is a working workaround.

Thanks

Andrew, thanks for that tip ! it fixed the issue regarding loginFailed, etc.

i’m still having another problem that maybe you two have faced. when i call Facebook.logout() the FB app never does a logout. so, in my Corona app, when i do FB.login() after FB.logout(), iOS switches to the FB app as it should, but FB is still showing the original authenticated user. thus the FB dialog displays “your app is already authorized…”.

what i was expecting is that the FB app would be showing its login screen to allow a user to input auth credentials to login as a different user.
am i misunderstanding something in the flow, is this a bug, or am i missing some FB call ?

thanks,
David

Hello David,

I think you misunderstood what logout does. It’s only internal corona call, it does not go out to facebook.

In order to remove your app from someones account you would have to call some fb api.

Krystian

Hi Krystian,

i don’t want to remove an authorized app from a FB account, i just want the local FB app to be in the Login state, where it is asking for username/password.
since the Corona facebook library interacts with the local FB app (eg, Facebook.login() ) i figured facebook.logout() would tell the local FB app to logout the user ON THE LOCAL FB APP.

if facebook.logout() doesn’t do that, then what DOES it do ? :slight_smile:

cheers,
David

Yes please, can someone please explain what does facebook.logout() actually do ?

hi Krystian,

i’m working on a project and have run into the same issue. i’ve been looking around for a way to view the status of this bug, but can’t find anything.

when you filed that bug, did you get a URL too ?

thanks,
David

Hi David,

no I did not, I was never able to follow any of the bugs I submit.

Krystian

Hi all,

I’ve tried this on both my iPad (using the Facebook app for login) and iPhone 4 (using Safari for login), and I’m not having any issues.  At the Facebook app authorization screen, if I click cancel, I receive the loginCancelled event.  If I then try to login again, it goes through successfully, including receiving the login event and the access token.

When I receive a loginCancelled or loginFailed event, I call facebook.logout().  That might be why it’s working for me.  I’d be curious if that resolves the issue you’re all experiencing.

  • Andrew

Andrew, you are correct.

Calling facebook.logout() after failed facebook.login() allowed me to retry the login phase.

This is a working workaround.

Thanks

Andrew, thanks for that tip ! it fixed the issue regarding loginFailed, etc.

i’m still having another problem that maybe you two have faced. when i call Facebook.logout() the FB app never does a logout. so, in my Corona app, when i do FB.login() after FB.logout(), iOS switches to the FB app as it should, but FB is still showing the original authenticated user. thus the FB dialog displays “your app is already authorized…”.

what i was expecting is that the FB app would be showing its login screen to allow a user to input auth credentials to login as a different user.
am i misunderstanding something in the flow, is this a bug, or am i missing some FB call ?

thanks,
David

Hello David,

I think you misunderstood what logout does. It’s only internal corona call, it does not go out to facebook.

In order to remove your app from someones account you would have to call some fb api.

Krystian

Hi Krystian,

i don’t want to remove an authorized app from a FB account, i just want the local FB app to be in the Login state, where it is asking for username/password.
since the Corona facebook library interacts with the local FB app (eg, Facebook.login() ) i figured facebook.logout() would tell the local FB app to logout the user ON THE LOCAL FB APP.

if facebook.logout() doesn’t do that, then what DOES it do ? :slight_smile:

cheers,
David