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

Weird behavior with facebook test users (gets redirect to connect page after accepting permission) #129

Closed
lmammino opened this issue Sep 26, 2012 · 7 comments

Comments

@lmammino
Copy link
Contributor

Hi,
I just tried connecting a Facebook test user. After giving permissions to the app i have been redirected to the connect page (hwi_oauth_connect route) instead of being redirect to the registration page.
That's really weird and happens only with facebook app test users (not with real ones).

Tell me if I can try something more to find out why the issue occurs.

You can find my whole codebase here: lmammino/just-had-a-cocktail

@stloyd
Copy link
Collaborator

stloyd commented Sep 26, 2012

Sorry to say, but according to my knowledge, those test users can't be easily used as users for OAuth testing, mainly because theirs sign-in urls are generated by facebook (for real ones it's generate by bundle with data from facebook), and it's one time use only, so those generated by bundle are leading to facebook OAuth error which blocks proper sign-in action.

@lmammino
Copy link
Contributor Author

Really weird.
This makes test users meaningless for most of the apps.

Thanks for the clarification. I'll dig further on google for this issue and let you know if I found something useful.

@lmammino
Copy link
Contributor Author

It seems that it should be possible: http://stackoverflow.com/questions/11431990/how-can-i-get-a-user-access-token-for-a-specific-facebook-test-user

And it seems that facebook team should be able to login with a test user to your app to approve your custom open graph actions and objects...

@lmammino
Copy link
Contributor Author

lmammino commented Oct 7, 2012

Problem spotted!
The problems is due to an exception thrown by the getValueForPath method of the PathUserResponse class.
When a path cannot be mapped an AuthenticationException is raised.
So the whole login process is stopped and the user is redirect to the default login page.

When using facebook test users they don't have a nickname (the nickname key/value couple is not present into the user object returned into the OAuth response) so if I mapped the nickname property I am not able to connect with that user...

I think we should throw a different kind of exception here or find another way to map proprerties.
For example we might have optional and mandatory properties, when a mandatory option misses we may throw the exception, otherwise we can simply provide a NULL value for that property...

@stloyd
Copy link
Collaborator

stloyd commented Oct 7, 2012

Maybe additional "response" class for facebook test users ?

@lmammino
Copy link
Contributor Author

lmammino commented Oct 7, 2012

I haven't tested it deeply, but I think the problem is not only for facebook test users. It seems to appear every time that a path response does not match a user property.
In case of the facebook test users the always does not have a nickname...

Anyway I'm not sure throwing an AuthenticationException is a good idea...

@asm89
Copy link
Contributor

asm89 commented Jan 8, 2013

I think this is fixed by the username/id refactoring @stloyd did earlier.

@asm89 asm89 closed this as completed Jan 8, 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