{"id":303871,"date":"2020-05-19T15:00:51","date_gmt":"2020-05-19T15:00:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=303871"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=303871","title":{"rendered":"\u041e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 JWT \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/502702\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a6\/oz\/ut\/a6ozutnu2esctapau7wo8-htm78.jpeg\"><\/div>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 JWT \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 2015 (<a href=\"https:\/\/tools.ietf.org\/html\/rfc7519\" rel=\"nofollow\">rfc7519<\/a>) \u043e\u0431\u0435\u0449\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 Access \u0442\u043e\u043a\u0435\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c Web, \u0433\u0434\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0435 \u0441\u0430\u0439\u0442\u044b, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043f\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 SPA.<\/p>\n<p>  \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0432\u0435\u0434\u0435\u0442 \u043a \u0438\u0445 \u043a\u0440\u0430\u0436\u0435 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430\u043c\u0438.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0422\u0430\u043a \u0438 \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c?<\/h3>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f JWT Access \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435:<\/p>\n<ol>\n<li><b>Local Storage\/Session Storage<\/b> \u2013 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0438 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d \u0430\u0442\u0430\u043a\u0430\u043c \u0442\u0438\u043f\u0430 XSS, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0412\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 CDN (\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 integrity \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c 100% \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c), \u043b\u0438\u0431\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u044b \u0447\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u0412\u0430\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u00ab\u0441\u043b\u0438\u0442\u044c\u00bb \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e \u0435\u0441\u043b\u0438 Local Storage \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043c\u0435\u0436\u0434\u0443 \u0442\u0430\u0431\u0430\u043c\u0438 \u0442\u043e Session Storage \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0430\u0439\u0442\u0430 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u043b\u0438\u0448\u044c \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0440\u0430\u0443\u043d\u0434 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438\/\u0440\u0435\u0444\u0440\u0435\u0448\u0430 Access \u0442\u043e\u043a\u0435\u043d\u0430.<\/li>\n<li>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u043b\u0436\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0430\u0442\u0430\u043a\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u0436\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e fetch \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u043d\u0430 \u043b\u0435\u0432\u044b\u0439 \u0441\u0430\u0439\u0442. \u0422\u0430\u043a \u0436\u0435 \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0434\u0432\u0443\u0445 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u2013 \u043d\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e.<\/li>\n<li><b>Cookies<\/b>. \u0412\u043e\u0442 \u043c\u044b \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c \u043a \u0441\u0442\u0430\u0440\u044b\u043c \u00ab\u043f\u0435\u0447\u0435\u043d\u044c\u043a\u0430\u043c\u00bb \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f cookie sessions. \u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f Access \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 cookie \u0447\u0440\u0435\u0432\u0430\u0442\u043e \u0430\u0442\u0430\u043a\u043e\u0439 CSRF. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e \u043e\u043d\u043e \u043d\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 XSS \u0430\u0442\u0430\u043a. \u0414\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 CSRF \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Cookie <b>SameSite <\/b>\u0432 \u0440\u0435\u0436\u0438\u043c <b>Strict<\/b>\u2013 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0443\u0442 \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0412\u0430\u0448\u0438 credentials, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u0438\u0448\u0438\u0442 \u0430\u0442\u0430\u043a\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 CSRF \u0430\u0442\u0430\u043a\u0443. <br \/>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0438 \u043f\u043b\u044e\u0441 \u2013 Access \u0442\u043e\u043a\u0435\u043d \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 JS \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <b>httpOnly<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <b>Secure<\/b> \u0442\u0430\u043a \u0436\u0435 \u0443\u0441\u0438\u043b\u0438\u0442 \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0441\u043d\u0438\u0444\u0444\u0438\u043d\u0433\u0430.\n<p>  \u0412\u0430\u0436\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Cookie \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f api \u0434\u043e\u043c\u0435\u043d\u0430\/\u043f\u0443\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u043a\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0438 \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u0432 header.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435?<\/h3>\n<p>  Cookies \u043f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u043c \u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f JWT Access \u0442\u043e\u043a\u0435\u043d\u0430 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c:<\/p>\n<ol>\n<li>\u0411\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f API \u0434\u043e\u043c\u0435\u043d\u0430\/\u043f\u0443\u0442\u0438 \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u043a \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c (\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\/\u0441\u0442\u0438\u043b\u044f\u043c\/js \u0444\u0430\u0439\u043b\u0430\u043c).<\/li>\n<li>\u0418\u043c\u0435\u0442\u044c \u0444\u043b\u0430\u0433 <b>Secure<\/b> (\u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e https).<\/li>\n<li>\u0418\u043c\u0435\u0442\u044c \u0444\u043b\u0430\u0433 <b>httpOnly<\/b> (\u0434\u043b\u044f \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438\u0437 JavaScript).<\/li>\n<li>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 <b>SameSite<\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <b>Strict<\/b> \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 CSRF \u0430\u0442\u0442\u0430\u043a, \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 Cookie \u0444\u0430\u0439\u043b\u043e\u0432 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0432\u0430\u0448\u0435\u043c\u0443 API \u0431\u044b\u043b \u043d\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e\u0433\u043e \u0432 Cookie \u0434\u043e\u043c\u0435\u043d\u0430.<\/li>\n<\/ol>\n<p>  \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e:<\/p>\n<ol>\n<li><a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/HTTP\/CSP\" rel=\"nofollow\"><b>Content-Security-Policy<\/b><\/a> \u2013 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 XSS \u0430\u0442\u0430\u043a <\/li>\n<li>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/X-Frame-Options\" rel=\"nofollow\"><b>X-Frame-Options<\/b><\/a> \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0430\u0442\u0430\u043a \u0442\u0438\u043f\u0430 clickjacking.<\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/HTTP\/%D0%97%D0%B0%D0%B3%D0%BE%D0%BB%D0%BE%D0%B2%D0%BA%D0%B8\/X-XSS-Protection\" rel=\"nofollow\"><b>X-XSS-Protection<\/b><\/a> \u2013 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0437\u0430\u0449\u0438\u0442\u044b \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043e\u0442 XSS \u0430\u0442\u0430\u043a.<\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/HTTP\/%D0%97%D0%B0%D0%B3%D0%BE%D0%BB%D0%BE%D0%B2%D0%BA%D0%B8\/X-Content-Type-Options\" rel=\"nofollow\"><b>X-Content-Type-Options<\/b><\/a> \u2013 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u044b MIME \u0442\u0438\u043f\u043e\u0432.<\/li>\n<\/ol>\n<p>  \u0421\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043c\u0435\u0440 \u0432 \u043a\u0443\u043f\u0435 \u0441 \u0447\u0430\u0441\u0442\u043e\u0439 \u0440\u043e\u0442\u0430\u0446\u0438\u0435\u0439 Access\/Refresh \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043c\u043e\u0447\u044c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/p>\n<h3>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>  \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <b>SameSite <\/b>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 <a href=\"https:\/\/caniuse.com\/#search=SameSite\" rel=\"nofollow\">\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 <\/a>, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0430\u043a \u0436\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0435\u0433\u043e \u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e (\u043f\u0440\u0438\u0432\u0435\u0442 IE \u0438 Safari \u0434\u043b\u044f \u043c\u0430\u043a\u0430). \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0443\u0436\u0435\u043d fallback \u043a CSRF \u0442\u043e\u043a\u0435\u043d\u0430\u043c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043a API \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438 CSRF \u0442\u043e\u043a\u0435\u043d. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 CSRF \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0441 \u0443\u0447\u0435\u0442\u043e\u043c <a href=\"https:\/\/habr.com\/ru\/company\/oleg-bunin\/blog\/321294\/\"><b>Fingerprint\u2019a <\/b><\/a> \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u0430 \u0431\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044b.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/502702\/\"> https:\/\/habr.com\/ru\/post\/502702\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/502702\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a6\/oz\/ut\/a6ozutnu2esctapau7wo8-htm78.jpeg\"><\/div>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 JWT \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 2015 (<a href=\"https:\/\/tools.ietf.org\/html\/rfc7519\" rel=\"nofollow\">rfc7519<\/a>) \u043e\u0431\u0435\u0449\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 Access \u0442\u043e\u043a\u0435\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c Web, \u0433\u0434\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0435 \u0441\u0430\u0439\u0442\u044b, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043f\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 SPA.<\/p>\n<p>  \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0432\u0435\u0434\u0435\u0442 \u043a \u0438\u0445 \u043a\u0440\u0430\u0436\u0435 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430\u043c\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-303871","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303871"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303871\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}