How does Facebook SSO know which app to return to?

时间秒杀一切 提交于 2020-01-22 03:38:26

问题


Using Facebook SSO (Single Sign on), after the system prompts the user for permissions to work with their Facebook account, it directs the user back to the app that SSO was being run in. How specifically does FB SSO accomplish this? (How does it know which app to reopen after the permissions are granted?)

We are building a SDK that interacts with Facebook, and it is not clear how the facebook app figures out which app to return to.


回答1:


When you add the Facebook SDK, one of the steps is to register a URL scheme for your app with your API key.

When you authorize the app in Facebook it tries to open the URL (usually formatted like fbXXXXXXXXXXX) and since your app is set to handle this URL scheme so the app is opened.

And here's a list of other apps you can communicate using handleOpenURL:

http://handleopenurl.com/



来源:https://stackoverflow.com/questions/10953229/how-does-facebook-sso-know-which-app-to-return-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!