{"id":183875,"date":"2020-10-27T04:08:48","date_gmt":"2020-10-26T20:08:48","guid":{"rendered":"http:\/\/4563.org\/?p=183875"},"modified":"2020-10-27T04:08:48","modified_gmt":"2020-10-26T20:08:48","slug":"%e5%9c%a8%e4%bd%bf%e7%94%a8-spring-%e5%86%99-rest-%e6%8e%a5%e5%8f%a3%e5%b7%a5%e7%a8%8b%e6%97%b6%ef%bc%8c%e4%bd%a0%e6%98%af%e4%bd%bf%e7%94%a8-spring-security-%e8%bf%98%e6%98%af%e8%87%aa%e5%ae%9a","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=183875","title":{"rendered":"\u5728\u4f7f\u7528 Spring \u5199 REST \u63a5\u53e3\u5de5\u7a0b\u65f6\uff0c\u4f60\u662f\u4f7f\u7528 Spring Security \u8fd8\u662f\u81ea\u5b9a\u4e49\u7684\u903b\u8f91\u6765\u5b9e\u73b0\u5b89\u5168\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5728\u4f7f\u7528 Spring \u5199 REST \u63a5\u53e3\u5de5\u7a0b\u65f6\uff0c\u4f60\u662f\u4f7f\u7528 Spring Security \u8fd8\u662f\u81ea\u5b9a\u4e49\u7684\u903b\u8f91\u6765\u5b9e\u73b0\u5b89\u5168\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qwerthhusn <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u81ea\u5df1\u5b9e\u73b0\u7684\u8bdd\u611f\u89c9\u4e5f\u4e0d\u590d\u6742\uff0c\u81f3\u5c11\u903b\u8f91\u81ea\u5df1\u5f88\u6e05\u695a\u6bd4\u8f83\u6e05\u6670\u3002<\/p>\n<p>\u4f7f\u7528 Spring Security \u7684\u8bdd\uff0c\u611f\u89c9\u770b\u7740\u5f88\u7b80\u5355\uff0c\u4f46\u662f\u5b9e\u9645\u7528\u8d77\u6765\u6ca1\u90a3\u4e48\u7b80\u5355\u3002\u800c\u4e14 Spring Security \u62e6\u622a\u540e\u8fd4\u56de\u7ed9 Client \u7684\u54cd\u5e94\u4e0d\u662f\u81ea\u5df1\u60f3\u8981\u7684\u6837\u5b50\u3002\u6211\u662f\u52a0\u4e0a\u4e00\u4e2a HandlerInterceptor \u5904\u7406<code>\/error<\/code>\u8bf7\u6c42\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3961789\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Oktfolio <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             http.exceptionHandling()<br \/> .accessDeniedHandler(accessDeniedHandler);<\/p>\n<p>http.formLogin()<br \/> .successHandler(authenticationSuccessHandler)<br \/> .failureHandler(authenticationFailureHandler);<\/p>\n<p>http.exceptionHandling()<br \/> .authenticationEntryPoint(authenticationEntryPoint);<\/p>\n<p>http.logout()<br \/> .logoutSuccessHandler(logoutSuccessHandler);                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3961790\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : qwerthhusn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Oktfolio \u8fd8\u6709\u8fd9\u4e9b\u554a\uff0c\u6211\u53bb\uff0c\u5f88\u591a Spring Security \u7684\u6982\u5ff5\u548c\u529f\u80fd\u6211\u90fd\u4e0d\u77e5\u9053\uff0c\u770b\u6765\u6211\u9700\u8981\u4ed4\u7ec6\u770b\u770b Spring Security \u7684\u6587\u6863\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3961791\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : leafre <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             shiro \u8f7b\u91cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528 Spring \u5199 REST&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\/183875"}],"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=183875"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/183875\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=183875"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=183875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}