When should the server-side vs. client-side Facebook authentication flows be used?

后端 未结 2 1564
不知归路
不知归路 2021-01-31 18:11

Facebook has two flows for Authentication, client-side and server-side. When should each one be used?

Facebook docs: https://developers.facebook.com/docs/authentication/

2条回答
  •  我在风中等你
    2021-01-31 18:51

    Depending on your needs you can use one or the other or both. If you want calls to facebook to be processed before the user sees a certain page then use server side... however if you want to display partial information until the user has authenticated, use javascript authentication.

    It boils down to this:

    • Javascript authentication can happen with-in a popup window and does not require a page reload you can also just perform a top.location.href redirect.
    • PHP authentication involves a redirect to an authentication page.

    Also see this thread, in particular this response.

提交回复
热议问题