官术网_书友最值得收藏!

There's more...

As an exercise, you might try to use Facebook SDK, which should be simpler to use for abstracting what we did into the SDK's API. Besides, using the SDK or not, one important thing that should be added to our code is the usage of the state parameter to avoid Cross Site Request Forgery (CSRF) attacks.

A CSRF attack allows a malicious user to execute operations in the name of another user (a victim). Regarding web applications, a valid approach to avoid CSRF is to make the client send a variable to the server with some random string which might be checked after receiving it back from the server's response, so the first value and the second (received) must be the same.

Regarding security issues, one other valuable suggestion is to send the access_token to the server side so you don't have to request a new access token on every web page of your application (but take care with the expiration time).

All the recipes that follow in this chapter will be using Spring Social project. For more information about the project, you can read the official documents at https://projects.spring.io/spring-social/.
主站蜘蛛池模板: 定南县| 德阳市| 泉州市| 财经| 方城县| 宜昌市| 报价| 池州市| 荥经县| 城步| 云浮市| 兰州市| 临泉县| 南溪县| 和田市| 稷山县| 洞头县| 连江县| 铜鼓县| 隆回县| 苏尼特左旗| 长白| 台南市| 义乌市| 闽清县| 吉首市| 吉首市| 栖霞市| 高邮市| 乌兰察布市| 曲周县| 庆城县| 旬阳县| 石棉县| 洮南市| 丽江市| 邹城市| 太谷县| 黔江区| 定结县| 阜阳市|