{"id":201250,"date":"2020-11-24T22:39:52","date_gmt":"2020-11-24T14:39:52","guid":{"rendered":"http:\/\/4563.org\/?p=201250"},"modified":"2020-11-24T22:39:52","modified_gmt":"2020-11-24T14:39:52","slug":"websocket-%e5%9c%a8-springsecurity-%e4%b8%8b%e7%bb%93%e5%90%88-jwt-%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=201250","title":{"rendered":"websocket \u5728 springsecurity \u4e0b\u7ed3\u5408 jwt \u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  websocket \u5728 springsecurity \u4e0b\u7ed3\u5408 jwt \u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : HenryWang0723 <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u9879\u76ee\u662f\u524d\u540e\u7aef\u5206\u79bb\uff0cSpringBoot+Vue\uff0c\u76ee\u524d\u7684\u63a5\u53e3\u90fd\u7528\u7684 SpringSecurity \u6846\u67b6\uff0c\u7981\u7528\u4e86 session \u6539\u4e3a\u4e86 jwt \u5355\u70b9\u767b\u5f55\uff0c\u73b0\u5728\u9879\u76ee\u8981\u52a0\u5165 websocket \u3002\u6211\u7406\u89e3\u7684 websocket \u53ea\u5728\u63e1\u624b\u7684\u65f6\u5019\u53d1 http\uff0c\u90a3\u4e48\u5728\u63e1\u624b\u65f6\u5728\u8bf7\u6c42\u7684 header \u91cc\u52a0 jwt token \uff08\u8c8c\u4f3c STOMP \u53ef\u4ee5\u505a\u5230\uff09\uff0c\u4f9d\u65e7\u7528 Security \u8fdb\u884c\u62e6\u622a\uff0c\u540e\u7eed websocket \u5efa\u7acb\u597d\u4e4b\u540e\u7684\u901a\u4fe1\u5c31\u81ea\u52a8\u653e\u8fc7\u4e86\uff1f\u8fd8\u662f\u8bf4\u6bcf\u4e00\u5305\u901a\u4fe1\u4f9d\u65e7\u662f http \u4f1a\u88ab Security \u5168\u90e8\u62e6\u622a..?<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4114769\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : okey <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u7406\u89e3\u7684\u662f\u540e\u7eed\u8d70\u7684\u4e0d\u662f ws \u534f\u8bae\uff0c\u548c SpringSecurity \u65e0\u5173\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4114770\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : okey <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @okey \u662f ws \u534f\u8bae\uff0c\u6253\u9519\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4114771\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : beichenhpy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5f53\u65f6\u505a\u6bd5\u8bbe\u4e5f\u662f\u7528\u7684\u548c\u4f60\u540c\u6837\u7684\u67b6\u6784\uff0c\u6700\u540e\u641e\u4e0d\u5b9a\u603b\u5f97\u7b2c\u4e09\u65b9\u7684 ws                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4114772\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : HenryWang0723 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @okey \u8fd9\u4e48\u8bf4\u6765\u53ea\u8981\u80fd\u5728\u63e1\u624b\u7684\u90a3\u5305 http \u8bf7\u6c42\u4e2d \u5728 header \u91cc\u52a0\u4e0a jwt token \u901a\u8fc7 Security \u7684\u62e6\u622a\u5668\u9a8c\u8bc1\u8fc7\u4e86\u5c31 ok \u4e86\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>websocket \u5728 sprin&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/201250"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=201250"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/201250\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=201250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=201250"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=201250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}