{"id":239181,"date":"2022-04-12T08:08:25","date_gmt":"2022-04-12T00:08:25","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=239181"},"modified":"2022-03-29T12:09:19","modified_gmt":"2022-03-29T04:09:19","slug":"springsecurity-shiro-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/springsecurity-shiro-linux.html","title":{"rendered":"\u7b80\u5355\u4ecb\u7ecdSpringSecurity\u6846\u67b6\u7b80\u4ecb\u53ca\u4e0eshiro\u7279\u70b9\u5bf9\u6bd4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8fd9\u7bc7\u6587\u7ae0\u662fSpringSecurity\u6846\u67b6\u7684\u5165\u95e8\u7bc7\uff0c\u4e3b\u8981\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u4e86SpringSecurity\u6846\u67b6\u7b80\u4ecb\u53ca\u4e0eshiro\u4f18\u7f3a\u70b9\u5bf9\u6bd4\u6709\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u501f\u9274\u53c2\u8003\u4e0b\uff0c\u5e0c\u671b\u80fd\u591f\u6709\u6240\u5e2e\u52a9
\n<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u672c\u4e13\u680f\u5185\u5bb9\u76ee\u524d\u5df2\u7ecf\u6bd4\u8f83\u7cfb\u7edf\u4e86\uff0c\u6838\u5fc3\u5185\u5bb9\u4e5f\u76f8\u5bf9\u5b8c\u6574\uff0c\u672c\u7cfb\u5217\u6587\u7ae0\u4f1a\u6839\u636eSpring Security\u793e\u533a\u7684\u53d1\u5c55\u9010\u6b65\u7684\u66f4\u65b0\u5185\u5bb9\u3002\u8bf7\u5927\u5bb6\u591a\u591a\u5173\u6ce8\u811a\u672c\u4e4b\u5bb6~<\/p>\n

\u4e00\u3001 SpringSecurity \u6846\u67b6\u7b80\u4ecb<\/strong><\/div>\n

\u5b98\u7f51\uff1ahttps:\/\/spring.io\/projects\/spring-security<\/p>\n

Spring Security \u662f\u5f3a\u5927\u7684\uff0c\u4e14\u5bb9\u6613\u5b9a\u5236\u7684\uff0c\u57fa\u4e8eSpring\u5f00\u53d1\u7684\u5b9e\u73b0\u8ba4\u8bc1\u767b\u5f55\u4e0e\u8d44\u6e90\u6388\u6743\u7684\u5e94\u7528\u5b89\u5168\u6846\u67b6\u3002<\/p>\n

SpringSecurity \u7684\u6838\u5fc3\u529f\u80fd\uff1a<\/p>\n

Authentication\uff1a\u8eab\u4efd\u8ba4\u8bc1\uff0c\u7528\u6237\u767b\u9646\u7684\u9a8c\u8bc1\uff08\u89e3\u51b3\u4f60\u662f\u8c01\u7684\u95ee\u9898\uff09<\/p>\n

Authorization\uff1a\u8bbf\u95ee\u6388\u6743\uff0c\u6388\u6743\u7cfb\u7edf\u8d44\u6e90\u7684\u8bbf\u95ee\u6743\u9650\uff08\u89e3\u51b3\u4f60\u80fd\u5e72\u4ec0\u4e48\u7684\u95ee\u9898\uff09<\/p>\n

\u5b89\u5168\u9632\u62a4\uff0c\u9632\u6b62\u8de8\u7ad9\u8bf7\u6c42\uff0csession \u653b\u51fb\u7b49<\/p>\n

\u4e8c\u3001\u6bd4\u8f83\u4e00\u4e0bshiro\u4e0eSpring Security<\/strong><\/div>\n

\u76ee\u524d\u5728java web\u5e94\u7528\u5b89\u5168\u6846\u67b6\u4e2d\uff0c\u4e0eSpring Security\u5f62\u6210\u76f4\u63a5\u7ade\u4e89\u7684\u5c31\u662fshiro\uff0c\u4e8c\u8005\u5728\u6838\u5fc3\u529f\u80fd\u4e0a\u51e0\u4e4e\u5dee\u4e0d\u591a\uff0c\u4f46\u4ece\u4f7f\u7528\u7684\u89d2\u5ea6\u5404\u6709\u4f18\u7f3a\u70b9\u3002\u7b14\u8005\u8ba4\u4e3a\uff1a\u6ca1\u6709\u6700\u597d\u7684\uff0c\u53ea\u6709\u6700\u5408\u9002\u7684\u3002<\/p>\n

2.1.\u7528\u6237\u91cf<\/strong><\/span><\/div>\n

Shiro\u7684\u4f7f\u7528\u91cf\u4e00\u76f4\u9ad8\u4e8espring security\u3002\u4f46\u662f\u4ece\u8d8b\u52bf\u4e0a\u6765\u770b\uff082020\u5e7410\u6708\u7684\u767e\u5ea6\u6307\u6570\uff09\uff0cSpring Security\u662f\u5728\u4e00\u76f4\u4e0a\u5347\u7684\uff0cshiro\u7684\u4f7f\u7528\u91cf\u540c\u6bd4\u3001\u73af\u6bd4\u90fd\u8fdb\u5165\u4e86\u4e0b\u6ed1\u671f\u3002<\/p>\n

2.2.\u4f7f\u7528\u7684\u65b9\u4fbf\u7a0b\u5ea6<\/strong><\/span><\/div>\n

\u901a\u5e38\u6765\u8bf4\uff0cshiro\u5165\u95e8\u66f4\u52a0\u5bb9\u6613\uff0c\u4f7f\u7528\u8d77\u6765\u4e5f\u975e\u5e38\u7b80\u5355\uff0c\u8fd9\u4e5f\u662f\u9020\u6210shiro\u7684\u4f7f\u7528\u91cf\u4e00\u76f4\u9ad8\u4e8eSpring Security\u7684\u4e3b\u8981\u539f\u56e0\u3002\u4f46\u662f\u4ece\u7b14\u8005\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u4e8c\u8005\u5176\u5b9e\u90fd\u7b80\u5355\uff0c\u6211\u8bf4\u8bf4\u6211\u7684\u7406\u7531\uff1a<\/p>\n

\u5728\u6ca1\u6709Spring Boot\u4e4b\u524d\uff0cSpring Security\u7684\u5927\u90e8\u5206\u914d\u7f6e\u8981\u901a\u8fc7XML\u5b9e\u73b0\uff0c\u914d\u7f6e\u8fd8\u662f\u8fd8\u662f\u975e\u5e38\u590d\u6742\u7684\u3002\u4f46\u662f\u6709\u4e86 Spring Boot\u4e4b\u540e\uff0c\u8fd9\u4e00\u60c5\u51b5\u5df2\u7ecf\u5f97\u5230\u663e\u8457\u6539\u5584\u3002<\/p>\n

Spring Security\u4e4b\u6240\u4ee5\u770b\u4e0a\u53bb\u6bd4shiro\u66f4\u590d\u6742\uff0c\u5176\u5b9e\u662f\u56e0\u4e3a\u5b83\u5f15\u5165\u4e86\u4e00\u4e9b\u4e0d\u5e38\u7528\u7684\u6982\u5ff5\u4e0e\u89c4\u5219\u3002\u5927\u5bb6\u5e94\u8be5\u90fd\u77e5\u90532\/8\u6cd5\u5219\uff0c\u8fd9\u5728Spring Security\u91cc\u9762\u4f53\u73b0\u7684\u7279\u522b\u660e\u663e\uff0c\u5982\u679c\u4f60\u53ea\u5b66Spring Security\u6700\u91cd\u8981\u7684\u90a320%\uff0c\u8fd920%\u7684\u590d\u6742\u5ea6\u548cshiro\u57fa\u672c\u662f\u4e00\u81f4\u7684\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e0d\u91cd\u8981\u7684\u90a380%\uff0c\u6070\u6070\u662fSpring Security\u6bd4shiro\u7684\u201c\u590d\u6742\u5ea6\u201d\u3002<\/p>\n

\u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u6709\u4eba\u80fd\u5e2e\u4f60\u628aSpring Security\u6700\u91cd\u8981\u7684\u90a320%\u6458\u51fa\u6765\uff0c\u4e8c\u8005\u7684\u5165\u95e8\u95e8\u69db\u3001\u590d\u6742\u5ea6\u5176\u5b9e\u662f\u5dee\u4e0d\u592a\u591a\u7684\u3002<\/p>\n

2.3.\u793e\u533a\u652f\u6301<\/strong><\/span><\/div>\n

Spring Security\u4f9d\u6258\u4e8eSpring\u5e9e\u5927\u7684\u793e\u533a\u652f\u6301\uff0c\u8fd9\u70b9\u81ea\u4e0d\u5fc5\u591a\u8bf4\u3002shiro\u5c5e\u4e8eapache\u793e\u533a\uff0c\u56e0\u4e3a\u5b83\u7684\u5e7f\u6cdb\u4f7f\u7528\uff0c\u6587\u6863\u4e5f\u975e\u5e38\u7684\u5168\u9762\u3002\u4e8c\u8005\u4ece\u793e\u533a\u652f\u6301\u6765\u770b\uff0c\u51e0\u4e4e\u4e0d\u76f8\u4e0a\u4e0b\u3002<\/p>\n

\u4f46\u662f\u4ece\u793e\u533a\u53d1\u5c55\u7684\u89d2\u5ea6\u770b\uff0cSpring Security\u660e\u663e\u66f4\u5360\u4f18\u52bf\uff0c\u968f\u7740Spring Cloud\u3001Spring Boot\u3001Spring Social\u7684\u957f\u8db3\u8fdb\u6b65\uff0c\u8fd9\u79cd\u4f18\u52bf\u4f1a\u8d8a\u6765\u8d8a\u5927\u3002\u56e0\u4e3aSpring Security\u6bd5\u7adf\u662fSpring\u7684\u4eb2\u513f\u5b50\uff0cSpring Security\u672a\u6765\u5728\u4e8eSpring\u7cfb\u5217\u6846\u67b6\u96c6\u6210\u7684\u65f6\u5019\u4e00\u5b9a\u4f1a\u6709\u66f4\u597d\u7684\u878d\u5408\u6027\uff0c\u524d\u77bb\u6027\u3001\u517c\u5bb9\u6027\uff01\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u8981\u5b66Spring Security\u7684\u4e3b\u8981\u539f\u56e0\uff01<\/p>\n

2.4.\u529f\u80fd\u4e30\u5bcc\u6027<\/strong><\/span><\/div>\n

Spring Security\u56e0\u4e3a\u5b83\u7684\u590d\u6742\uff0c\u6240\u4ee5\u4ece\u529f\u80fd\u7684\u4e30\u5bcc\u6027\u7684\u89d2\u5ea6\u66f4\u80dc\u4e00\u7b79\u3002\u5176\u4e2d\u6bd4\u8f83\u5178\u578b\u7684\u5982\uff1a<\/p>\n

Spring Security\u9ed8\u8ba4\u542b\u6709\u5bf9OAuth2.0\u7684\u652f\u6301\uff0c\u4e0eSpring Social\u4e00\u8d77\u4f7f\u7528\u5b8c\u6210\u793e\u4ea4\u5a92\u4f53\u767b\u5f55\u4e5f\u6bd4\u8f83\u65b9\u4fbf\u3002shiro\u5728\u8fd9\u65b9\u9762\u53ea\u80fd\u9760\u81ea\u5df1\u5199\u4ee3\u7801\u5b9e\u73b0\u3002<\/p>\n

\u8fd8\u6709\u4e00\u79cd\u666e\u904d\u8bf4\u6cd5\uff1aSpring Security\u5728\u7f51\u7edc\u5b89\u5168\u7684\u65b9\u9762\u4e0b\u7684\u529f\u592b\u66f4\u591a\uff0c\u4f46\u662f\u7b14\u8005\u5e76\u672a\u6709\u975e\u5e38\u76f4\u63a5\u7684\u611f\u53d7\uff0c\u6709\u53ef\u80fd\u51fa\u73b0\u5b89\u5168\u95ee\u9898\u7684\u65f6\u5019\u624d\u4f1a\u611f\u5230\u4e0d\u591f\u5b89\u5168\u7684\u75db\u3002<\/p>\n

\u4e09\u3001\u603b\u7ed3
\n<\/strong><\/div>\n

\u5982\u679c\u4f60\u53ea\u662f\u60f3\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684web\u5e94\u7528\uff0cshiro\u66f4\u52a0\u7684\u8f7b\u91cf\u7ea7\uff0c\u5b66\u4e60\u6210\u672c\u4e5f\u66f4\u4f4e\u3002\u5982\u679c\u60a8\u6b63\u5728\u5f00\u53d1\u4e00\u4e2a\u5206\u5e03\u5f0f\u7684\u3001\u5fae\u670d\u52a1\u7684\u3001\u6216\u8005\u4e0eSpring Cloud\u7cfb\u5217\u6846\u67b6\u6df1\u5ea6\u96c6\u6210\u7684\u9879\u76ee\uff0c\u7b14\u8005\u8fd8\u662f\u5efa\u8bae\u60a8\u4f7f\u7528Spring Security\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u672c\u4e13\u680f\u5185\u5bb9\u76ee\u524d\u5df2\u7ecf\u6bd4\u8f83\u7cfb\u7edf\u4e86\uff0c\u6838\u5fc3\u5185\u5bb9\u4e5f\u76f8\u5bf9\u5b8c\u6574\uff0c\u672c\u7cfb\u5217\u6587\u7ae0\u4f1a\u6839\u636eSpring Security\u793e\u533a\u7684\u53d1\u5c55\u9010\u6b65 […]<\/p>\n","protected":false},"author":668,"featured_media":109920,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-239181","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/239181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=239181"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/239181\/revisions"}],"predecessor-version":[{"id":239184,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/239181\/revisions\/239184"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/109920"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=239181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=239181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=239181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}