Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Facebook Login Does Not Return Token After Previous Login Was Cancelled
Started by krystian6 Apr 16 2013 12:21 AM

11 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

krystian6

[GLOBAL: userInfoPane.html]
krystian6
  • Contributor

  • 555 posts
  • Corona SDK

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



[TOPIC: post.html]
#2

vavius

[GLOBAL: userInfoPane.html]
vavius
  • Observer

  • 7 posts
  • Corona SDK

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. 



[TOPIC: post.html]
#3

krystian6

[GLOBAL: userInfoPane.html]
krystian6
  • Contributor

  • 555 posts
  • Corona SDK

I've reported this under 

Case 23018

[TOPIC: post.html]
#4

dmccuskey

[GLOBAL: userInfoPane.html]
dmccuskey
  • Contributor

  • 156 posts
  • Enterprise

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

[TOPIC: post.html]
#5

krystian6

[GLOBAL: userInfoPane.html]
krystian6
  • Contributor

  • 555 posts
  • Corona SDK

Hi David,

 

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

 

Krystian



[TOPIC: post.html]
#6

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

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



[TOPIC: post.html]
#7

krystian6

[GLOBAL: userInfoPane.html]
krystian6
  • Contributor

  • 555 posts
  • Corona SDK

Andrew, you are correct.

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

 

This is a working workaround.

 

Thanks



[TOPIC: post.html]
#8

dmccuskey

[GLOBAL: userInfoPane.html]
dmccuskey
  • Contributor

  • 156 posts
  • Enterprise

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

[TOPIC: post.html]
#9

krystian6

[GLOBAL: userInfoPane.html]
krystian6
  • Contributor

  • 555 posts
  • Corona SDK

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



[TOPIC: post.html]
#10

dmccuskey

[GLOBAL: userInfoPane.html]
dmccuskey
  • Contributor

  • 156 posts
  • Enterprise

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 ? :)

cheers,
David

[TOPIC: post.html]
#11

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

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



[TOPIC: post.html]
#12

dmccuskey

[GLOBAL: userInfoPane.html]
dmccuskey
  • Contributor

  • 156 posts
  • Enterprise

so i went and created a new Facebook module. =) it is its own entity, not a wrapper of the Corona version.

 

i needed it for a client project i was working on. as mentioned above, the app needed logout() to actually logout the user because it's to be used in kiosk-mode, ie, lots of users, not just one. there are a couple other differences as well.

 

for those of you who are early adopters and/or interested there is more info here:  =)

 

http://docs.davidmccuskey.com/display/docs/dmc_facebook.lua

https://github.com/dmccuskey/DMC-Corona-Library

 

cheers,

dmc

 




[topic_controls]
[/topic_controls]