{"id":16305,"date":"2024-03-16T03:50:18","date_gmt":"2024-03-15T18:50:18","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/"},"modified":"2025-08-06T06:34:56","modified_gmt":"2025-08-05T21:34:56","slug":"springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/","title":{"rendered":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f"},"content":{"rendered":"<p>SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u306b\u5f93\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n<ol>\n<li>pom.xml\u30d5\u30a1\u30a4\u30eb<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dependency<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>org.springframework.boot<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>spring-boot-starter-security<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">dependency<\/span>&gt;<\/span>\r\n\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dependency<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>io.jsonwebtoken<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>jjwt<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">version<\/span>&gt;<\/span>0.9.1<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">version<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">dependency<\/span>&gt;<\/span>\r\n<\/code><\/pre>\n<ol>\n<li>\u30e6\u30fc\u30b6\u30fc\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u3092\u4f5c\u6210\u3057\u307e\u3059\uff1a\u30e6\u30fc\u30b6\u30fc\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u3084\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3069\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u542b\u3081\u307e\u3059\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">User<\/span> {\r\n    <span class=\"hljs-keyword\">private<\/span> String username;\r\n    <span class=\"hljs-keyword\">private<\/span> String password;\r\n\r\n    <span class=\"hljs-comment\">\/\/ getter and setter<\/span>\r\n}\r\n<\/code><\/pre>\n<ol>\n<li>\u30e6\u30fc\u30b6\u30fc\u306e\u8a73\u7d30\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u30b5\u30fc\u30d3\u30b9<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-meta\">@Service<\/span>\r\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">UserDetailsServiceImpl<\/span> <span class=\"hljs-keyword\">implements<\/span> <span class=\"hljs-title class_\">UserDetailsService<\/span> {\r\n\r\n    <span class=\"hljs-meta\">@Override<\/span>\r\n    <span class=\"hljs-keyword\">public<\/span> UserDetails <span class=\"hljs-title function_\">loadUserByUsername<\/span><span class=\"hljs-params\">(String username)<\/span> <span class=\"hljs-keyword\">throws<\/span> UsernameNotFoundException {\r\n        <span class=\"hljs-comment\">\/\/ \u4ece\u6570\u636e\u5e93\u6216\u5176\u4ed6\u6570\u636e\u6e90\u52a0\u8f7d\u7528\u6237\u4fe1\u606f<\/span>\r\n        <span class=\"hljs-type\">User<\/span> <span class=\"hljs-variable\">user<\/span> <span class=\"hljs-operator\">=<\/span> userRepository.findByUsername(username);\r\n        <span class=\"hljs-keyword\">if<\/span> (user == <span class=\"hljs-literal\">null<\/span>) {\r\n            <span class=\"hljs-keyword\">throw<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">UsernameNotFoundException<\/span>(<span class=\"hljs-string\">\"User not found\"<\/span>);\r\n        }\r\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">org<\/span>.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(), <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">ArrayList<\/span>&lt;&gt;());\r\n    }\r\n}\r\n<\/code><\/pre>\n<ol>\n<li>\u30ed\u30b0\u30a4\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\uff1a\u30e6\u30fc\u30b6\u30fc\u306e\u30ed\u30b0\u30a4\u30f3\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30ed\u30b0\u30a4\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-meta\">@RestController<\/span>\r\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">LoginController<\/span> {\r\n\r\n    <span class=\"hljs-meta\">@Autowired<\/span>\r\n    <span class=\"hljs-keyword\">private<\/span> AuthenticationManager authenticationManager;\r\n    <span class=\"hljs-meta\">@Autowired<\/span>\r\n    <span class=\"hljs-keyword\">private<\/span> JwtUtils jwtUtils;\r\n\r\n    <span class=\"hljs-meta\">@PostMapping(\"\/login\")<\/span>\r\n    <span class=\"hljs-keyword\">public<\/span> ResponseEntity&lt;?&gt; login(<span class=\"hljs-meta\">@RequestBody<\/span> User user) {\r\n        <span class=\"hljs-keyword\">try<\/span> {\r\n            authenticationManager.authenticate(<span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">UsernamePasswordAuthenticationToken<\/span>(user.getUsername(), user.getPassword()));\r\n            <span class=\"hljs-type\">String<\/span> <span class=\"hljs-variable\">token<\/span> <span class=\"hljs-operator\">=<\/span> jwtUtils.generateToken(user.getUsername());\r\n            <span class=\"hljs-keyword\">return<\/span> ResponseEntity.ok(token);\r\n        } <span class=\"hljs-keyword\">catch<\/span> (Exception e) {\r\n            <span class=\"hljs-keyword\">return<\/span> ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();\r\n        }\r\n    }\r\n}\r\n<\/code><\/pre>\n<ol>\n<li>JWT\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\uff1aJWT\u3092\u751f\u6210\u304a\u3088\u3073\u89e3\u6790\u3059\u308b\u305f\u3081\u306eJWT\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-meta\">@Component<\/span>\r\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">JwtUtils<\/span> {\r\n\r\n    <span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">final<\/span> <span class=\"hljs-type\">String<\/span> <span class=\"hljs-variable\">secret<\/span> <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-string\">\"your-secret-key\"<\/span>;\r\n    <span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">final<\/span> <span class=\"hljs-type\">long<\/span> <span class=\"hljs-variable\">expiration<\/span> <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-number\">86400000<\/span>;\r\n\r\n    <span class=\"hljs-keyword\">public<\/span> String <span class=\"hljs-title function_\">generateToken<\/span><span class=\"hljs-params\">(String username)<\/span> {\r\n        <span class=\"hljs-type\">Date<\/span> <span class=\"hljs-variable\">now<\/span> <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">Date<\/span>();\r\n        <span class=\"hljs-type\">Date<\/span> <span class=\"hljs-variable\">expiryDate<\/span> <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">Date<\/span>(now.getTime() + expiration);\r\n\r\n        <span class=\"hljs-keyword\">return<\/span> Jwts.builder()\r\n                .setSubject(username)\r\n                .setIssuedAt(now)\r\n                .setExpiration(expiryDate)\r\n                .signWith(SignatureAlgorithm.HS512, secret)\r\n                .compact();\r\n    }\r\n\r\n    <span class=\"hljs-keyword\">public<\/span> String <span class=\"hljs-title function_\">getUsernameFromToken<\/span><span class=\"hljs-params\">(String token)<\/span> {\r\n        <span class=\"hljs-keyword\">return<\/span> Jwts.parser()\r\n                .setSigningKey(secret)\r\n                .parseClaimsJws(token)\r\n                .getBody()\r\n                .getSubject();\r\n    }\r\n\r\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-type\">boolean<\/span> <span class=\"hljs-title function_\">isTokenValid<\/span><span class=\"hljs-params\">(String token, UserDetails userDetails)<\/span> {\r\n        <span class=\"hljs-type\">String<\/span> <span class=\"hljs-variable\">username<\/span> <span class=\"hljs-operator\">=<\/span> getUsernameFromToken(token);\r\n        <span class=\"hljs-keyword\">return<\/span> (username.equals(userDetails.getUsername()) &amp;&amp; !isTokenExpired(token));\r\n    }\r\n\r\n    <span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-type\">boolean<\/span> <span class=\"hljs-title function_\">isTokenExpired<\/span><span class=\"hljs-params\">(String token)<\/span> {\r\n        <span class=\"hljs-type\">Date<\/span> <span class=\"hljs-variable\">expirationDate<\/span> <span class=\"hljs-operator\">=<\/span> Jwts.parser()\r\n                .setSigningKey(secret)\r\n                .parseClaimsJws(token)\r\n                .getBody()\r\n                .getExpiration();\r\n        <span class=\"hljs-keyword\">return<\/span> expirationDate.before(<span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">Date<\/span>());\r\n    }\r\n}\r\n<\/code><\/pre>\n<ol>\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-attr\">spring.security.user.name<\/span>=<span class=\"hljs-string\">admin<\/span>\r\n<span class=\"hljs-attr\">spring.security.user.password<\/span>=<span class=\"hljs-string\">admin<\/span>\r\n<span class=\"hljs-attr\">spring.security.user.roles<\/span>=<span class=\"hljs-string\">USER,ADMIN<\/span>\r\n<\/code><\/pre>\n<ol>\n<li>JWT\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u8a2d\u5b9a\u3059\u308b\uff1aJWT\u3092\u691c\u8a3c\u3057\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u8a8d\u8a3c\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306eJWT\u30d5\u30a3\u30eb\u30bf\u30fc\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-meta\">@Component<\/span>\r\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">JwtTokenFilter<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title class_\">OncePerRequestFilter<\/span> {\r\n\r\n    <span class=\"hljs-meta\">@Autowired<\/span>\r\n    <span class=\"hljs-keyword\">private<\/span> JwtUtils jwtUtils;\r\n    <span class=\"hljs-meta\">@Autowired<\/span>\r\n    <span class=\"hljs-keyword\">private<\/span> UserDetailsServiceImpl userDetailsService;\r\n\r\n    <span class=\"hljs-meta\">@Override<\/span>\r\n    <span class=\"hljs-keyword\">protected<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title function_\">doFilterInternal<\/span><span class=\"hljs-params\">(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)<\/span> <span class=\"hljs-keyword\">throws<\/span> ServletException, IOException {\r\n        <span class=\"hljs-type\">String<\/span> <span class=\"hljs-variable\">header<\/span> <span class=\"hljs-operator\">=<\/span> request.getHeader(<span class=\"hljs-string\">\"Authorization\"<\/span>);\r\n\r\n        <span class=\"hljs-keyword\">if<\/span> (StringUtils.hasText(header) &amp;&amp; header.startsWith(<span class=\"hljs-string\">\"Bearer \"<\/span>)) {\r\n            <span class=\"hljs-type\">String<\/span> <span class=\"hljs-variable\">token<\/span> <span class=\"hljs-operator\">=<\/span> header.substring(<span class=\"hljs-number\">7<\/span>);\r\n            <span class=\"hljs-type\">String<\/span> <span class=\"hljs-variable\">username<\/span> <span class=\"hljs-operator\">=<\/span> jwtUtils.getUsernameFromToken(token);\r\n\r\n            <span class=\"hljs-keyword\">if<\/span> (StringUtils.hasText(username) &amp;&amp; SecurityContextHolder.getContext().getAuthentication() == <span class=\"hljs-literal\">null<\/span>) {\r\n                <span class=\"hljs-type\">UserDetails<\/span> <span class=\"hljs-variable\">userDetails<\/span> <span class=\"hljs-operator\">=<\/span> userDetailsService.loadUserByUsername(username);\r\n\r\n                <span class=\"hljs-keyword\">if<\/span> (jwtUtils.isTokenValid(token, userDetails)) {\r\n                    <span class=\"hljs-type\">UsernamePasswordAuthenticationToken<\/span> <span class=\"hljs-variable\">authenticationToken<\/span> <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">UsernamePasswordAuthenticationToken<\/span>(userDetails, <span class=\"hljs-literal\">null<\/span>, userDetails.getAuthorities());\r\n                    authenticationToken.setDetails(<span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">WebAuthenticationDetailsSource<\/span>().buildDetails(request));\r\n                    SecurityContextHolder.getContext().setAuthentication(authenticationToken);\r\n                }\r\n            }\r\n        }\r\n\r\n        filterChain.doFilter(request, response);\r\n    }\r\n}\r\n<\/code><\/pre>\n<ol>\n<li>Spring Security\u306e\u8a2d\u5b9a<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u306b\u5f93\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a pom.xml\u30d5\u30a1\u30a4\u30eb &lt;dependency&gt; &lt;groupId&gt;org.spri [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-16305","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"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>SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\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\/springboot\u3068jwt\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\" \/>\n<meta property=\"og:description\" content=\"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\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\/springboot\u3068jwt\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-15T18:50:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-05T21:34:56+00:00\" \/>\n<meta name=\"author\" content=\"\u685c, \u6625\u6a39\" \/>\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=\"\u685c, \u6625\u6a39\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"10\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\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/\",\"name\":\"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2024-03-15T18:50:18+00:00\",\"dateModified\":\"2025-08-05T21:34:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341\"},\"description\":\"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\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\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\"}]},{\"@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\/ff22288af1a5455571aff7586b0fb341\",\"name\":\"\u685c, \u6625\u6a39\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g\",\"caption\":\"\u685c, \u6625\u6a39\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/sakuraharuki\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f - Blog - Silicon Cloud","description":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\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\/springboot\u3068jwt\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\/","og_locale":"ja_JP","og_type":"article","og_title":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f","og_description":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\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\/springboot\u3068jwt\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-15T18:50:18+00:00","article_modified_time":"2025-08-05T21:34:56+00:00","author":"\u685c, \u6625\u6a39","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u685c, \u6625\u6a39","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"10\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/","name":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2024-03-15T18:50:18+00:00","dateModified":"2025-08-05T21:34:56+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341"},"description":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f\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\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"SpringBoot\u3068JWT\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3067\u3059\u304b\uff1f"}]},{"@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\/ff22288af1a5455571aff7586b0fb341","name":"\u685c, \u6625\u6a39","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g","caption":"\u685c, \u6625\u6a39"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/sakuraharuki\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/springboot%e3%81%a8jwt%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%e3%80%81%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/16305","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=16305"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/16305\/revisions"}],"predecessor-version":[{"id":91598,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/16305\/revisions\/91598"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=16305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=16305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=16305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}