{"id":8257,"date":"2023-11-28T20:20:42","date_gmt":"2023-11-28T12:20:42","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=8257"},"modified":"2023-12-06T10:15:15","modified_gmt":"2023-12-06T02:15:15","slug":"shiro-he-spring-security-ru-he-xuan-ze","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/11\/28\/shiro-he-spring-security-ru-he-xuan-ze\/","title":{"rendered":"Shiro \u548c Spring Security \u5982\u4f55\u9009\u62e9\uff1f"},"content":{"rendered":"<p>Apache Shiro\u548cSpring Security\u90fd\u662f\u7528\u4e8e\u5e94\u7528\u7a0b\u5e8f\u5b89\u5168\u9886\u57df\u7684\u5f3a\u5927\u6846\u67b6\uff0c\u5b83\u4eec\u90fd\u63d0\u4f9b\u4e86\u8eab\u4efd\u9a8c\u8bc1\uff08Authentication\uff09\u3001\u6388\u6743\uff08Authorization\uff09\u7b49\u6838\u5fc3\u5b89\u5168\u529f\u80fd\u3002\u5728\u9009\u62e9\u4f7f\u7528Shiro\u8fd8\u662fSpring Security\u65f6\uff0c\u4f60\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u51e0\u4e2a\u56e0\u7d20\uff1a<\/p>\n<ol>\n<li>\n<strong>\u96c6\u6210\u6027\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Spring Security\uff1a<\/strong> Spring Security\u662f\u7531Spring\u751f\u6001\u7cfb\u7edf\u63d0\u4f9b\u7684\u5b89\u5168\u6846\u67b6\uff0c\u4e0eSpring\u6846\u67b6\u5b8c\u7f8e\u96c6\u6210\u3002\u5982\u679c\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u5df2\u7ecf\u4f7f\u7528\u4e86Spring\u6846\u67b6\uff0c\u90a3\u4e48\u4f7f\u7528Spring Security\u53ef\u80fd\u66f4\u52a0\u81ea\u7136\u548c\u65e0\u7f1d\u3002<\/li>\n<li><strong>Shiro\uff1a<\/strong> Apache Shiro\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u6846\u67b6\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u96c6\u6210\u5230\u5404\u79cdJava\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u65e0\u8bba\u662f\u5426\u4f7f\u7528Spring\u3002\u5982\u679c\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e0d\u662f\u57fa\u4e8eSpring\u7684\uff0cShiro\u53ef\u80fd\u662f\u4e00\u4e2a\u66f4\u8f7b\u91cf\u7ea7\u7684\u9009\u62e9\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u7075\u6d3b\u6027\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Spring Security\uff1a<\/strong> Spring Security\u63d0\u4f9b\u4e86\u9ad8\u5ea6\u53ef\u5b9a\u5236\u7684\u7279\u6027\uff0c\u4f46\u914d\u7f6e\u548c\u4f7f\u7528\u4e0a\u53ef\u80fd\u76f8\u5bf9\u7e41\u7410\u3002\u5b83\u901a\u5e38\u66f4\u9002\u5408\u5927\u578b\u3001\u590d\u6742\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u53ef\u6269\u5c55\u6027\u3002<\/li>\n<li><strong>Shiro\uff1a<\/strong> Shiro\u4ee5\u7b80\u5355\u548c\u76f4\u89c2\u7684\u65b9\u5f0f\u63d0\u4f9b\u4e86\u4e00\u4e9b\u57fa\u672c\u7684\u5b89\u5168\u7279\u6027\uff0c\u66f4\u9002\u7528\u4e8e\u4e2d\u5c0f\u578b\u5e94\u7528\u7a0b\u5e8f\u3002Shiro\u7684\u8bbe\u8ba1\u76ee\u6807\u4e4b\u4e00\u662f\u4f7f\u5b89\u5168\u6027\u80fd\u591f\u5728\u4e0d\u727a\u7272\u7075\u6d3b\u6027\u7684\u60c5\u51b5\u4e0b\u66f4\u6613\u4e8e\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5b66\u4e60\u66f2\u7ebf\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Spring Security\uff1a<\/strong> \u7531\u4e8eSpring Security\u63d0\u4f9b\u4e86\u8bb8\u591a\u529f\u80fd\u548c\u914d\u7f6e\u9009\u9879\uff0c\u56e0\u6b64\u5b66\u4e60\u66f2\u7ebf\u53ef\u80fd\u76f8\u5bf9\u9661\u5ced\u3002\u7136\u800c\uff0c\u4e00\u65e6\u638c\u63e1\u4e86\u5b83\u7684\u57fa\u672c\u6982\u5ff5\uff0c\u5c31\u80fd\u591f\u5145\u5206\u5229\u7528\u5176\u5f3a\u5927\u7684\u529f\u80fd\u3002<\/li>\n<li><strong>Shiro\uff1a<\/strong> Shiro\u8bbe\u8ba1\u5f97\u76f8\u5bf9\u7b80\u5355\uff0c\u5b66\u4e60\u8d77\u6765\u53ef\u80fd\u66f4\u5bb9\u6613\u4e0a\u624b\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u521d\u5b66\u8005\u3002Shiro\u7684\u6587\u6863\u901a\u5e38\u4e5f\u88ab\u8ba4\u4e3a\u662f\u6e05\u6670\u548c\u6613\u4e8e\u7406\u89e3\u7684\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u793e\u533a\u548c\u6587\u6863\u652f\u6301\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Spring Security\uff1a<\/strong> \u7531\u4e8e\u662fSpring\u9879\u76ee\u7684\u4e00\u90e8\u5206\uff0cSpring Security\u62e5\u6709\u5e9e\u5927\u7684\u793e\u533a\u548c\u4e30\u5bcc\u7684\u6587\u6863\u652f\u6301\u3002\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u53ef\u80fd\u80fd\u591f\u4ece\u793e\u533a\u83b7\u5f97\u66f4\u591a\u7684\u5e2e\u52a9\u548c\u652f\u6301\u3002<\/li>\n<li><strong>Shiro\uff1a<\/strong> Shiro\u7684\u793e\u533a\u76f8\u5bf9\u8f83\u5c0f\uff0c\u4f46\u4e5f\u662f\u4e00\u4e2a\u6d3b\u8dc3\u7684\u793e\u533a\u3002\u867d\u7136\u6587\u6863\u76f8\u5bf9\u7b80\u6d01\uff0c\u4f46\u4e5f\u6709\u5f88\u591a\u7528\u6237\u6210\u529f\u4f7f\u7528Shiro\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u7efc\u5408\u8003\u8651\u4e0a\u8ff0\u56e0\u7d20\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9Spring Security\u6216Shiro\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u9700\u6c42\u3001\u56e2\u961f\u7ecf\u9a8c\u4ee5\u53ca\u4e2a\u4eba\u504f\u597d\u3002\u5982\u679c\u4f60\u5df2\u7ecf\u5728\u4f7f\u7528Spring\u6846\u67b6\u5e76\u4e14\u9700\u8981\u5f3a\u5927\u7684\u529f\u80fd\u548c\u6269\u5c55\u6027\uff0c\u90a3\u4e48Spring Security\u53ef\u80fd\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002\u5982\u679c\u4f60\u60f3\u8981\u4e00\u4e2a\u7b80\u5355\u3001\u76f4\u89c2\u3001\u8f7b\u91cf\u7ea7\u7684\u6846\u67b6\uff0c\u6216\u8005\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e0d\u662f\u57fa\u4e8eSpring\u7684\uff0c\u90a3\u4e48Shiro\u53ef\u80fd\u66f4\u9002\u5408\u4f60\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache Shiro\u548cSpring Security\u90fd\u662f\u7528\u4e8e\u5e94\u7528\u7a0b\u5e8f\u5b89\u5168\u9886\u57df\u7684\u5f3a\u5927\u6846\u67b6\uff0c\u5b83\u4eec\u90fd\u63d0\u4f9b\u4e86\u8eab\u4efd\u9a8c [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[100],"tags":[],"class_list":["post-8257","post","type-post","status-publish","format-standard","hentry","category-springboot"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=8257"}],"version-history":[{"count":2,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8257\/revisions"}],"predecessor-version":[{"id":16593,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8257\/revisions\/16593"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=8257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=8257"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=8257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}