Express Registration
From Facebook Developers Wiki
Many developers have an application or business with a pre-existing user base outside of Facebook. We developed Express Registration as a way for developers to give these non-Facebook users a streamlined way to join Facebook with your application already added to those users' accounts. Just follow the steps in this article.
First, you need to create a link to http://www.facebook.com/p.php with the following GET parameters:
- api_key - your API key. This parameter is required.
- e - the email address to auto-fill in the registration form. The user can modify it before the account is created. This parameter is optional.
- n - the name to auto-fill in the registration form. The user can modify it before the account is created. This parameter is optional.
- next - a registration parameter for your own use. The value gets added to post-add URL, so it should be a URL-encoded query string part. More information is below. This parameter is optional.
Note: Linking to p.php redirects a user to your application's About page (which is the desired endpoint), whereas linking to r.php links to the login page and doesn't support all of the above parameters.
If a non-Facebook user follows the registration link and chooses to register, she then follows the normal registration flow. Once the user clicks the link in her confirmation email, Facebook then pings your post-add URL. Note that this is slightly different than the normal application add process; since the user is still going through the Facebook new user orientation process, she won't actually be redirected to your post-add page. Instead, a Facebook server sends an HTTP POST to the following URL:
Where next is the parameter you passed to r.php, separator is either ? or & depending upon if your URL already has a ?, and auth_token can basically be ignored. In addition, the usual fb_sig* variables get POSTed to your page, including most relevantly:
Of course, before processing this request, you should validate that the fb_sig parameters are properly signed, as usual.
Note: If your user is already a Facebook user and follows that link she then gets redirected straight to the Add Application page if she is logged in. If she is not already logged in, she can log in through the login form on the left side of the screen, after which she is taken to the add page. In this case post-add URL call would also pass next parameter value.
[edit] New User Registration Flow
When a user who already uses your application signs up for Facebook, she sees the following screens.
1. Registration Page
2. New User Orientation
3. Post-Orientation Feed
