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

  • OAuth 2.0 Cookbook
  • Adolfo Eloy Nascimento
  • 192字
  • 2021-07-08 09:35:02

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/.
主站蜘蛛池模板: 永德县| 高唐县| 化州市| 项城市| 大庆市| 乌鲁木齐市| 承德市| 嵩明县| 郧西县| 饶河县| 静海县| 梁河县| 常州市| 那坡县| 宁河县| 大连市| 清水县| 林州市| 思茅市| 保定市| 横峰县| 峨眉山市| 林口县| 永德县| 沙雅县| 民和| 莱西市| 安福县| 抚远县| 梅河口市| 上林县| 长宁县| 错那县| 天峻县| 白朗县| 景泰县| 浪卡子县| 芒康县| 肃宁县| 资阳市| 理塘县|