{"id":354,"date":"2023-03-10T01:12:45","date_gmt":"2023-10-15T15:06:26","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/"},"modified":"2025-07-31T22:55:22","modified_gmt":"2025-07-31T13:55:22","slug":"%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","title":{"rendered":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb"},"content":{"rendered":"<p>Spring Security\u306f\u3001\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306e\u8a8d\u8a3c\u3068\u8a8d\u53ef\u3092\u884c\u3046\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002Spring Security\u306f\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d9\u30fc\u30b9\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3<\/h2>\n<p>Spring Security\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306e\u3044\u304f\u3064\u304b\u306e\u5229\u70b9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u8a3c\u660e\u3055\u308c\u305f\u6280\u8853\u3067\u3042\u308b\u305f\u3081\u3001\u8eca\u8f2a\u306e\u518d\u767a\u660e\u3088\u308a\u3082\u3053\u308c\u3092\u4f7f\u7528\u3059\u308b\u65b9\u304c\u826f\u3044\u3067\u3059\u3002\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u8981\u7d20\u3067\u3042\u308a\u3001\u305d\u3046\u3057\u306a\u3044\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u653b\u6483\u8005\u306b\u5bfe\u3057\u3066\u8106\u5f31\u306b\u306a\u308a\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>CSRF\u3084\u30bb\u30c3\u30b7\u30e7\u30f3\u56fa\u5b9a\u653b\u6483\u306a\u3069\u3001\u4e00\u90e8\u306e\u4e00\u822c\u7684\u306a\u653b\u6483\u3092\u9632\u304e\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u3069\u3093\u306a\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3082\u7c21\u5358\u306b\u7d71\u5408\u3067\u304d\u307e\u3059\u3002\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u69cb\u6210\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002Spring\u306f\u81ea\u52d5\u7684\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u6ce8\u5165\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30a4\u30f3\u30e1\u30e2\u30ea\u3001DAO\u3001JDBC\u3001LDAP\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u65b9\u6cd5\u3067\u306e\u8a8d\u8a3c\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u7279\u5b9a\u306eURL\u30d1\u30bf\u30fc\u30f3\u3092\u7121\u8996\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u3001\u9759\u7684HTML\u3084\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u63d0\u4f9b\u3059\u308b\u306e\u306b\u4fbf\u5229\u3067\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u30b0\u30eb\u30fc\u30d7\u3084\u5f79\u5272\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/ol>\n<h3>\u30b9\u30d7\u30ea\u30f3\u30b0\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b<\/h3>\n<p>\u79c1\u305f\u3061\u306f\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u3092Spring Security\u3068\u7d71\u5408\u3057\u307e\u3059\u3002Eclipse\u306e\u300cDynamic Web Project\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3001\u30b9\u30b1\u30eb\u30c8\u30f3\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u6e96\u5099\u3057\u307e\u3059\u3002\u30d3\u30eb\u30c9\u3068\u5c55\u958b\u306bMaven\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u305d\u308c\u3092Maven\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u3089\u306e\u624b\u9806\u306b\u6163\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001Java Web Application Tutorial\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3067\u4fdd\u8b77\u3057\u305f\u5f8c\u3001\u6700\u7d42\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u69cb\u9020\u306f\u4ee5\u4e0b\u306e\u753b\u50cf\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u79c1\u305f\u3061\u306f3\u3064\u306eSpring Security\u8a8d\u8a3c\u30e1\u30bd\u30c3\u30c9\u3092\u8abf\u3079\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30a4\u30f3\u30e1\u30e2\u30ea\u30fc<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>JDBC<\/ol>\n<p>JDBC\u3092\u5229\u7528\u3057\u3066\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u8a73\u7d30\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>CREATE TABLE `Employees` (\r\n  `username` varchar(20) NOT NULL DEFAULT '',\r\n  `password` varchar(20) NOT NULL DEFAULT '',\r\n  `enabled` tinyint(1) NOT NULL DEFAULT '1',\r\n  PRIMARY KEY (`username`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\nCREATE TABLE `Roles` (\r\n  `username` varchar(20) NOT NULL DEFAULT '',\r\n  `role` varchar(20) NOT NULL DEFAULT '',\r\n  PRIMARY KEY (`username`,`role`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\nINSERT INTO `Employees` (`username`, `password`, `enabled`)\r\nVALUES\r\n\t('scdev', 'scdev123', 1);\r\n\r\nINSERT INTO `Roles` (`username`, `role`)\r\nVALUES\r\n\t('scdev', 'Admin'),\r\n\t('scdev', 'CEO');\r\n\r\ncommit;\r\n<\/code><\/pre>\n<p>\u308f\u305f\u3057\u305f\u3061\u306f\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30b3\u30f3\u30c6\u30ca\u5185\u3067JDBC\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092JNDI\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u3001\u300cTomcat JNDI DataSource Example\u300d\u3092\u8aad\u3093\u3067\u5b66\u3076\u3053\u3068\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<h3>\u6625\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u30e1\u30a4\u30f4\u30f3\u4f9d\u5b58\u95a2\u4fc2<\/h3>\n<p>\u4ee5\u4e0b\u306f\u79c1\u305f\u3061\u306e\u6700\u7d42\u7684\u306apom.xml\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;project xmlns=\"https:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"https:\/\/maven.apache.org\/POM\/4.0.0 https:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\t&lt;groupId&gt;WebappSpringSecurity&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;WebappSpringSecurity&lt;\/artifactId&gt;\r\n\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n\t&lt;packaging&gt;war&lt;\/packaging&gt;\r\n\t&lt;dependencies&gt;\r\n\t\t&lt;!-- Spring Security Artifacts - START --&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-security-web&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;3.2.3.RELEASE&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-security-config&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;3.2.3.RELEASE&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-security-taglibs&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;3.0.5.RELEASE&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;!-- Spring Security Artifacts - END --&gt;\r\n\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;jstl&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;1.2&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;compile&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.servlet.jsp&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;jsp-api&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;2.1&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;javax.servlet-api&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;3.0.1&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;commons-logging&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;commons-logging&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;1.1.1&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-jdbc&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;4.0.2.RELEASE&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t&lt;\/dependencies&gt;\r\n\t&lt;build&gt;\r\n\t\t&lt;sourceDirectory&gt;src&lt;\/sourceDirectory&gt;\r\n\t\t&lt;plugins&gt;\r\n\t\t\t&lt;plugin&gt;\r\n\t\t\t\t&lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n\t\t\t\t&lt;version&gt;3.1&lt;\/version&gt;\r\n\t\t\t\t&lt;configuration&gt;\r\n\t\t\t\t\t&lt;source&gt;1.7&lt;\/source&gt;\r\n\t\t\t\t\t&lt;target&gt;1.7&lt;\/target&gt;\r\n\t\t\t\t&lt;\/configuration&gt;\r\n\t\t\t&lt;\/plugin&gt;\r\n\t\t\t&lt;plugin&gt;\r\n\t\t\t\t&lt;artifactId&gt;maven-war-plugin&lt;\/artifactId&gt;\r\n\t\t\t\t&lt;version&gt;2.3&lt;\/version&gt;\r\n\t\t\t\t&lt;configuration&gt;\r\n\t\t\t\t\t&lt;warSourceDirectory&gt;WebContent&lt;\/warSourceDirectory&gt;\r\n\t\t\t\t\t&lt;failOnMissingWebXml&gt;false&lt;\/failOnMissingWebXml&gt;\r\n\t\t\t\t&lt;\/configuration&gt;\r\n\t\t\t&lt;\/plugin&gt;\r\n\t\t&lt;\/plugins&gt;\r\n\t&lt;\/build&gt;\r\n&lt;\/project&gt;\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306f\u3001Spring Framework\u306b\u95a2\u9023\u3059\u308b\u4f9d\u5b58\u95a2\u4fc2\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>spring-jdbc: \u3053\u308c\u306fJDBC\u8a8d\u8a3c\u65b9\u6cd5\u306b\u3088\u308bJDBC\u64cd\u4f5c\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002JNDI\u3068\u3057\u3066DataSource\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5fc5\u8981\u3067\u3059\u3002\u4f7f\u7528\u4f8b\u306e\u5b8c\u5168\u7248\u306b\u3064\u3044\u3066\u306f\u3001Spring DataSource JNDI Example\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>spring-security-taglibs: Spring Security\u306e\u30bf\u30b0\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001JSP\u30da\u30fc\u30b8\u3067\u30e6\u30fc\u30b6\u30fc\u306e\u5f79\u5272\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002\u305f\u3060\u3057\u3001\u307b\u3068\u3093\u3069\u306e\u5834\u5408\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>spring-security-config: \u8a8d\u8a3c\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u8a2d\u5b9a\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002JDBC\u3001DAO\u3001LDAP\u306a\u3069\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>spring-security-web: \u3053\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306fSpring Security\u3092Servlet API\u306b\u7d71\u5408\u3057\u307e\u3059\u3002Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\u3092\u30d7\u30e9\u30b0\u30a4\u30f3\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u3067\u3059\u3002<\/ol>\n<p>\u307e\u305f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3088\u3063\u3066\u30ea\u30b9\u30ca\u30fc\u3084\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306bServlet API 3.0 \u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u307e\u3059\u306e\u3067\u3001\u4f9d\u5b58\u95a2\u4fc2\u306b\u304a\u3044\u3066Servlet API\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f3.0\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30b9\u30d7\u30ea\u30f3\u30b0\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30d3\u30e5\u30fc\u30da\u30fc\u30b8<\/h3>\n<p>\u6211\u3005\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u306fJSP\u3068HTML\u30da\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002HTML\u30da\u30fc\u30b8\u4ee5\u5916\u306e\u3059\u3079\u3066\u306e\u30da\u30fc\u30b8\u306b\u8a8d\u8a3c\u3092\u9069\u7528\u3057\u305f\u3044\u3067\u3059\u3002 health.html<\/p>\n<pre class=\"post-pre\"><code>&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"UTF-8\"&gt;\r\n&lt;title&gt;Health Check&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;h3&gt;Service is up and running!!&lt;\/h3&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<p>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9.jsp<\/p>\n<pre class=\"post-pre\"><code>&lt;%@ page language=\"java\" contentType=\"text\/html; charset=UTF-8\"\r\n    pageEncoding=\"UTF-8\"%&gt;\r\n&lt;%@ taglib uri=\"https:\/\/java.sun.com\/jsp\/jstl\/core\" prefix=\"c\" %&gt;\r\n&lt;%@ taglib uri=\"https:\/\/www.springframework.org\/security\/tags\" prefix=\"sec\" %&gt;\r\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\" \"https:\/\/www.w3.org\/TR\/html4\/loose.dtd\"&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"&gt;\r\n&lt;title&gt;Home Page&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h3&gt;Home Page&lt;\/h3&gt;\r\n\r\n\t&lt;p&gt;\r\n      Hello &lt;b&gt;&lt;c:out value=\"${pageContext.request.remoteUser}\"\/&gt;&lt;\/b&gt;&lt;br&gt;\r\n      Roles: &lt;b&gt;&lt;sec:authentication property=\"principal.authorities\" \/&gt;&lt;\/b&gt;\r\n    &lt;\/p&gt;\r\n    \r\n    &lt;form action=\"logout\" method=\"post\"&gt;\r\n      &lt;input type=\"submit\" value=\"Logout\" \/&gt;\r\n      &lt;input type=\"hidden\" name=\"${_csrf.parameterName}\" value=\"${_csrf.token}\"\/&gt;\r\n    &lt;\/form&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30d7\u30ed\u30a4\u8a18\u8ff0\u5b50\u306b\u306findex.jsp\u3092welcome-file\u3068\u3057\u3066\u542b\u3081\u307e\u3057\u305f\u3002Spring Security\u304cCSRF\u653b\u6483\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u3001\u30ed\u30b0\u30a2\u30a6\u30c8\u306e\u30d5\u30a9\u30fc\u30e0\u3092\u9001\u4fe1\u3059\u308b\u969b\u306b\u306f\u3001CSRF\u30c8\u30fc\u30af\u30f3\u3092\u30b5\u30fc\u30d0\u30fc\u306b\u9001\u4fe1\u3057\u3066\u524a\u9664\u3057\u307e\u3059\u3002Spring Security\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u3088\u3063\u3066\u8a2d\u5b9a\u3055\u308c\u305fCSRF\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u300c_csrf\u300d\u3067\u3042\u308a\u3001\u305d\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u540d\u3068\u30c8\u30fc\u30af\u30f3\u5024\u3092\u30ed\u30b0\u30a2\u30a6\u30c8\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u6e21\u3059\u305f\u3081\u306b\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3067\u306f\u3001\u4eca\u5ea6\u306fSpring Security\u306e\u8a2d\u5b9a\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>Spring Security\u306e\u4f8b\u3068\u3057\u3066UserDetailsService DAO\u306e\u5b9f\u88c5<\/h3>\n<p>DAO\u30d9\u30fc\u30b9\u306e\u8a8d\u8a3c\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001UserDetailsService\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u3066loadUserByUsername()\u30e1\u30bd\u30c3\u30c9\u306e\u5b9f\u88c5\u3092\u63d0\u4f9b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u7406\u60f3\u7684\u306b\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u3092\u691c\u8a3c\u3059\u308b\u305f\u3081\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3079\u304d\u3067\u3059\u304c\u3001\u7c21\u5358\u306e\u305f\u3081\u306b\u57fa\u672c\u7684\u306a\u691c\u8a3c\u306e\u307f\u884c\u3063\u3066\u3044\u307e\u3059\u3002AppUserDetailsServiceDAO.java<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.webapp.spring.dao;\r\n\r\nimport java.util.Collection;\r\nimport java.util.List;\r\n\r\nimport org.apache.commons.logging.Log;\r\nimport org.apache.commons.logging.LogFactory;\r\nimport org.springframework.security.core.GrantedAuthority;\r\nimport org.springframework.security.core.authority.SimpleGrantedAuthority;\r\nimport org.springframework.security.core.userdetails.UserDetails;\r\nimport org.springframework.security.core.userdetails.UserDetailsService;\r\nimport org.springframework.security.core.userdetails.UsernameNotFoundException;\r\n\r\npublic class AppUserDetailsServiceDAO implements UserDetailsService {\r\n\r\n\tprotected final Log logger = LogFactory.getLog(getClass());\r\n\t\r\n\t@Override\r\n\tpublic UserDetails loadUserByUsername(final String username)\r\n\t\t\tthrows UsernameNotFoundException {\r\n\t\t\r\n\t\tlogger.info(\"loadUserByUsername username=\"+username);\r\n\t\t\r\n\t\tif(!username.equals(\"scdev\")){\r\n\t\t\tthrow new UsernameNotFoundException(username + \" not found\");\r\n\t\t}\r\n\t\t\r\n\t\t\/\/creating dummy user details, should do JDBC operations\r\n\t\treturn new UserDetails() {\r\n\t\t\t\r\n\t\t\tprivate static final long serialVersionUID = 2059202961588104658L;\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isEnabled() {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isCredentialsNonExpired() {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isAccountNonLocked() {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isAccountNonExpired() {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic String getUsername() {\r\n\t\t\t\treturn username;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic String getPassword() {\r\n\t\t\t\treturn \"scdev123\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic Collection&lt;? extends GrantedAuthority&gt; getAuthorities() {\r\n\t\t\t\tList&lt;SimpleGrantedAuthority&gt; auths = new java.util.ArrayList&lt;SimpleGrantedAuthority&gt;();\r\n\t\t\t\tauths.add(new SimpleGrantedAuthority(\"admin\"));\r\n\t\t\t\treturn auths;\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u6ce8\u610f\u70b9\u3067\u3059\u304c\u3001UserDetails\u306e\u533f\u540d\u5185\u90e8\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3066\u8fd4\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6c17\u3065\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u308c\u306b\u5bfe\u3057\u3066\u3001\u5b9f\u88c5\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3066\u305d\u308c\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u3066\u8fd4\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u901a\u5e38\u3001\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u305d\u306e\u65b9\u6cd5\u304c\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n<h3>Spring Security\u306e\u4f8b\u3068\u3057\u3066\u3001WebSecurityConfigurer\u306e\u5b9f\u88c5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/h3>\n<p>\u79c1\u305f\u3061\u306f\u3001WebSecurityConfigurer\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u304b\u3001\u57fa\u672c\u7684\u306a\u5b9f\u88c5\u30af\u30e9\u30b9\u3067\u3042\u308bWebSecurityConfigurerAdapter\u3092\u62e1\u5f35\u3057\u3001\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002SecurityConfig.java<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.webapp.spring.security;\r\n\r\nimport javax.naming.Context;\r\nimport javax.naming.InitialContext;\r\nimport javax.sql.DataSource;\r\n\r\nimport org.springframework.context.annotation.Configuration;\r\nimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;\r\nimport org.springframework.security.config.annotation.web.builders.WebSecurity;\r\nimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\r\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\r\n\r\nimport com.scdev.webapp.spring.dao.AppUserDetailsServiceDAO;\r\n\r\n@Configuration\r\n@EnableWebSecurity\r\npublic class SecurityConfig extends WebSecurityConfigurerAdapter {\r\n\r\n\t@Override\r\n\tpublic void configure(AuthenticationManagerBuilder auth)\r\n\t\t\tthrows Exception {\r\n\r\n\t\t\/\/ in-memory authentication\r\n\t\t\/\/ auth.inMemoryAuthentication().withUser(\"scdev\").password(\"scdev123\").roles(\"USER\");\r\n\r\n\t\t\/\/ using custom UserDetailsService DAO\r\n\t\t\/\/ auth.userDetailsService(new AppUserDetailsServiceDAO());\r\n\r\n\t\t\/\/ using JDBC\r\n\t\tContext ctx = new InitialContext();\r\n\t\tDataSource ds = (DataSource) ctx\r\n\t\t\t\t.lookup(\"java:\/comp\/env\/jdbc\/MyLocalDB\");\r\n\r\n\t\tfinal String findUserQuery = \"select username,password,enabled \"\r\n\t\t\t\t+ \"from Employees \" + \"where username = ?\";\r\n\t\tfinal String findRoles = \"select username,role \" + \"from Roles \"\r\n\t\t\t\t+ \"where username = ?\";\r\n\t\t\r\n\t\tauth.jdbcAuthentication().dataSource(ds)\r\n\t\t\t\t.usersByUsernameQuery(findUserQuery)\r\n\t\t\t\t.authoritiesByUsernameQuery(findRoles);\r\n\t}\r\n\t\r\n\t@Override\r\n    public void configure(WebSecurity web) throws Exception {\r\n        web\r\n            .ignoring()\r\n                \/\/ Spring Security should completely ignore URLs ending with .html\r\n                .antMatchers(\"\/*.html\");\r\n    }\r\n\r\n}\r\n<\/code><\/pre>\n<p>configure(WebSecurity web)\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u3067\u3001\u3059\u3079\u3066\u306eHTML\u30d5\u30a1\u30a4\u30eb\u3092\u7121\u8996\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001JDBC\u8a8d\u8a3c\u3092\u30d7\u30e9\u30b0\u30a4\u30f3\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u79c1\u305f\u3061\u306fDataSource\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3067\u305d\u308c\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30ab\u30b9\u30bf\u30e0\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u8a73\u7d30\u3068\u5f79\u5272\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306eSELECT\u30af\u30a8\u30ea\u3082\u63d0\u4f9b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30a4\u30f3\u30e1\u30e2\u30ea\u30d9\u30fc\u30b9\u3068DAO\u30d9\u30fc\u30b9\u306e\u8a8d\u8a3c\u3092\u8a2d\u5b9a\u3059\u308b\u306e\u306f\u7c21\u5358\u3067\u3059\u304c\u3001\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u305d\u308c\u3089\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u89e3\u9664\u3067\u304d\u307e\u3059\u304c\u3001\u4e00\u5ea6\u306b1\u3064\u306e\u8a2d\u5b9a\u306e\u307f\u3092\u6301\u3064\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002@Configuration\u3068@EnableWebSecurity\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u3053\u306e\u30af\u30e9\u30b9\u304cSpring Security\u306e\u8a2d\u5b9a\u306b\u4f7f\u7528\u3055\u308c\u308b\u3053\u3068\u304cSpring\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u8a8d\u8b58\u3055\u308c\u307e\u3059\u3002Spring Security\u306e\u8a2d\u5b9a\u306fBuilder\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001authenticate\u30e1\u30bd\u30c3\u30c9\u306b\u57fa\u3065\u3044\u3066\u3001\u4e00\u90e8\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u5f8c\u3067\u4f7f\u7528\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001auth.userDetailsService()\u306fUserDetailsService\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3057\u3001\u305d\u308c\u4ee5\u964d\u306bDataSource\u3092\u8a2d\u5b9a\u3059\u308b\u306a\u3069\u306e\u4ed6\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<h3>Servlet API\u3068Spring Security Web\u306e\u7d71\u5408<\/h3>\n<p>\u6700\u5f8c\u306e\u30d1\u30fc\u30c8\u306f\u3001Spring Security\u306e\u8a2d\u5b9a\u30af\u30e9\u30b9\u3092\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8API\u306b\u7d71\u5408\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u306f\u3001AbstractSecurityWebApplicationInitializer\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3057\u3001\u30b9\u30fc\u30d1\u30fc\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\u30af\u30e9\u30b9\u3092\u6e21\u3059\u3053\u3068\u3067\u7c21\u5358\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002SecurityWebApplicationInitializer.java<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.webapp.spring.security;\r\n\r\nimport org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;\r\n\r\npublic class SecurityWebApplicationInitializer extends\r\n\t\tAbstractSecurityWebApplicationInitializer {\r\n\r\n\tpublic SecurityWebApplicationInitializer() {\r\n        super(SecurityConfig.class);\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>\u79c1\u305f\u3061\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306e\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u6642\u306b\u306f\u3001ServletContext\u3092\u4f7f\u7528\u3057\u3066ContextLoaderListener\u30ea\u30b9\u30ca\u30fc\u3092\u8ffd\u52a0\u3057\u3001\u79c1\u305f\u3061\u306e\u8a2d\u5b9a\u30af\u30e9\u30b9\u3092Servlet Filter\u3068\u3057\u3066\u767b\u9332\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u308c\u306fServlet-3\u6e96\u62e0\u306e\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30b3\u30f3\u30c6\u30ca\u3067\u306e\u307f\u6a5f\u80fd\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001Apache Tomcat\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u304c7.0\u4ee5\u4e0a\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u6e96\u5099\u304c\u3067\u304d\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u304a\u597d\u304d\u306a\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30b3\u30f3\u30c6\u30ca\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u79c1\u306f\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306bApache Tomcat-7\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u753b\u50cf\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u30b7\u30ca\u30ea\u30aa\u3067\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306a\u3057\u3067HTML\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b<\/h4>\n<h4>\u8a8d\u8a3c\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u8a8d\u8a3c\u60c5\u5831\u304c\u9593\u9055\u3063\u3066\u3044\u307e\u3059\u3002<\/h4>\n<h4>\u30b9\u30d7\u30ea\u30f3\u30b0\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3JDBC\u8a8d\u8a3c\u3092\u4f7f\u7528\u3057\u305f\u30db\u30fc\u30e0\u30da\u30fc\u30b8<\/h4>\n<h4>\u30b9\u30d7\u30ea\u30f3\u30b0 \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306eUserDetailsService DAO\u8a8d\u8a3c\u3092\u5099\u3048\u305f\u30db\u30fc\u30e0\u30da\u30fc\u30b8<\/h4>\n<h4>\u30b9\u30d7\u30ea\u30f3\u30b0\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u4f7f\u7528\u3057\u305f\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306e\u30e1\u30e2\u30ea\u8a8d\u8a3c\u6a5f\u80fd\u3092\u6301\u3063\u305f\u30da\u30fc\u30b8<\/h4>\n<h4>\u30ed\u30b0\u30a2\u30a6\u30c8\u30da\u30fc\u30b8<\/h4>\n<p>\u3082\u3057Servlet Specs 3\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044Servlet\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u3092\u901a\u3058\u3066DispatcherServlet\u3092\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001WebApplicationInitializer\u306eJavaDoc\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u308c\u304cSpring Security\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3068Servlet\u30d9\u30fc\u30b9\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306e\u7d71\u5408\u306e\u3059\u3079\u3066\u3067\u3059\u3002\u8a73\u3057\u304f\u5b66\u3076\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u300cSpring Servlet Security \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Security\u306f\u3001\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306e\u8a8d\u8a3c\u3068\u8a8d\u53ef\u3092\u884c\u3046\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002Spring Security\u306f\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d9\u30fc\u30b9\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 Sp [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[19,26],"class_list":["post-354","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-19","tag-26"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" \/>\n<meta property=\"og:description\" content=\"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-15T15:06:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T13:55:22+00:00\" \/>\n<meta name=\"author\" content=\"\u82bd\u4f9d, \u96e8\u591c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u82bd\u4f9d, \u96e8\u591c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"30\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\",\"name\":\"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-10-15T15:06:26+00:00\",\"dateModified\":\"2025-07-31T13:55:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/aeb60a7861f2f002b54c66bd65bc6c27\"},\"description\":\"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/aeb60a7861f2f002b54c66bd65bc6c27\",\"name\":\"\u82bd\u4f9d, \u96e8\u591c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g\",\"caption\":\"\u82bd\u4f9d, \u96e8\u591c\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/meiamaya\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud","description":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/","og_locale":"ja_JP","og_type":"article","og_title":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb","og_description":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-15T15:06:26+00:00","article_modified_time":"2025-07-31T13:55:22+00:00","author":"\u82bd\u4f9d, \u96e8\u591c","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u82bd\u4f9d, \u96e8\u591c","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"30\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","name":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-10-15T15:06:26+00:00","dateModified":"2025-07-31T13:55:22+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/aeb60a7861f2f002b54c66bd65bc6c27"},"description":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"\u6625\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4f8b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/aeb60a7861f2f002b54c66bd65bc6c27","name":"\u82bd\u4f9d, \u96e8\u591c","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g","caption":"\u82bd\u4f9d, \u96e8\u591c"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/meiamaya\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e6%98%a5%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%81%ae%e4%be%8b%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=354"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":39523,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/354\/revisions\/39523"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}