Authenticated Referrals vs. OAuth - post informations to website?

374 Views Asked by At

At the moment i use the PHP serverside OAuth-Authentification by creating a "Login by facebook" button. As the App also is in the sidebar, i want to use the authentificated referrals for users to directly access that App. The problem is that, even though the access may be granted, i need to get this login-query-string to my website to save all access tokens, informations etc.

So - how exactly can i set the url to redirect the user to after the app is given permission?

1

There are 1 best solutions below

0
On BEST ANSWER

When the user is sent to your app facebook will also send the auth data along with the request.
In the Authenticated Referrals section of the Auth Dialog documentation it says:

3 . Auth Token Parameter: If Authenticated Referrals is enabled and when a user authorizes your app through the in-line Auth Dialog, we will pass your app the Auth Token in the format specified here. Available formats:

  • URI Fragment: if your app is using client-side authentication
  • Query String: if your app is using server-side authentication. If your app is a canvas app, we will not use this setting and will use the "signed_request" as the response type automatically.

If your app is a canvas app you'll simply get all the needed data with the "signed_request", otherwise it will be part of the querystring.
For more user data you then simply make api requests.