How to authenticate multiple entry points in a facebook app?

Posted by Simon_Weaver on Stack Overflow See other posts from Stack Overflow or by Simon_Weaver
Published on 2010-05-22T09:02:43Z Indexed on 2010/05/22 9:10 UTC
Read the original article Hit count: 253

Filed under:
|
|

I am using an IFrame application with XFBML and the new Javascript API.

I'd like to have a facebook application with multiple entry points. These will most likely represent different links coming from a fan page tab.

I can do this quite easily if the pages don't require authentication - for instance I can create several pages under the app and if a new user comes I can send them to any page:

http://apps.facebook.com/myapp/offers
http://apps.facebook.com/myapp/game
http://apps.facebook.com/myapp/products

The problem is that if I need to have authentication then once the user is authenticated they get redirected to my default post-authorization url.

Is there a way for a user that comes to /game to stay on /game after they are authenticated without redirecting.

I thought I could do it with the AJAX login form - but I cannot find out how to do that in a Facebook IFrame application.

I think the example using requirelogin only works for FBML.

<a href="http://apps.facebook.com/mysmiley" requirelogin=1> Welcome to my app</a>.

Is there a way to accomplish this with Facebook APIs - or will I have to do some kind of clever cookie handling?

© Stack Overflow or respective owner

Related posts about facebook

Related posts about facebook-api