{"id":7576,"date":"2017-12-21T20:32:46","date_gmt":"2017-12-21T11:32:46","guid":{"rendered":"https:\/\/52.185.133.111\/?p=7576"},"modified":"2021-04-29T17:08:14","modified_gmt":"2021-04-29T08:08:14","slug":"json-web-token%e3%81%ab%e3%82%88%e3%82%8b%e8%aa%8d%e8%a8%bc","status":"publish","type":"post","link":"https:\/\/tech-lab.sios.jp\/archives\/7576","title":{"rendered":"JSON Web Token\u306b\u3088\u308b\u8a8d\u8a3c"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u30b5\u30a4\u30aa\u30b9\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u6280\u8853\u90e8\u306e\u6b66\u4e95\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001JSON Web Token\u306e\u4ed5\u69d8\u306b\u5f93\u3063\u305f\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092Linux\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u524d\u306b\u3001JSON Web Token\u3092\u8aac\u660e\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>JSON Web Token\u3068\u306f\uff1f<\/h2>\n<p>JSON Web Token\u3068\u306f\u3001JSON\u306b\u96fb\u5b50\u7f72\u540d\u3092\u884c\u3044\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u305d\u306eJSON\u306e\u691c\u8a3c\u3092\u884c\u3044\u3001\u8a8d\u8a3c\u53ef\u5426\u3092\u6c7a\u5b9a\u3059\u308b\u4ed5\u69d8\u3067\u3059\u3002OpenID\u3084OAuth\u306a\u3069\u306b\u7528\u3044\u3089\u308c\u3066\u3044\u308b\u6a19\u6e96\u7684\u306a\u4ed5\u69d8\u3067\u3059\u3002<\/p>\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3053\u3068\u3067\u3082\u540c\u69d8\u306e\u3053\u3068\u3092\u5b9f\u73fe\u304c\u3067\u304d\u307e\u3059\u304c\u3001JSON Web Token\u306e\u5834\u5408\u306f\u3001\u30c8\u30fc\u30af\u30f3\u305d\u306e\u3082\u306e\u3092\u691c\u8a3c\u3059\u308b\u3053\u3068\u3067\u8a8d\u8a3c\u53ef\u5426\u3092\u5224\u65ad\u3059\u308b\u306e\u3067\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u3068\u306f\u9055\u3044\u3001\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u4f55\u3082\u6301\u3064\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30c8\u30fc\u30af\u30f3\u3092\u767a\u884c\u3057\u305f\u30db\u30b9\u30c8\u3068\u3001\u30c8\u30fc\u30af\u30f3\u3092\u691c\u8a3c\u3059\u308b\u30db\u30b9\u30c8\u304c\u5225\u3005\u3067\u3082\u3088\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>\u3088\u304f\u3042\u308b\u8aac\u660e\u306a\u306e\u3067\u3059\u304c\u3001\u30a4\u30de\u30a4\u30c1\u308f\u304b\u308a\u306b\u304f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>JSON Web Token\u306e\u4ed5\u69d8\u306b\u5f93\u3063\u3066\u4f5c\u6210\u3055\u308c\u305f\u30c8\u30fc\u30af\u30f3\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e-KAnHN1YuKAnTrigJxudGFrZWnigJ19.97763576b44cbadea825195aa610b3b9ce71a52f228f3a2b41eba30e7e8350ad\r\n<\/pre>\n<p>\u9577\u3044\u6587\u5b57\u5217\u3067\u3059\u304c\u3001\u69cb\u6210\u3068\u3057\u3066\u306f\u3001\u30d8\u30c3\u30c0\u30fc\u3001\u30da\u30a4\u30ed\u30fc\u30c9\u3001\u30d8\u30c3\u30c0\u30fc\u3068\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u3064\u306a\u3044\u3067\u7f72\u540d\u3057\u305f\u3082\u306e\u306e3\u3064\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u3064\u306a\u3052\u305f\u3082\u306e\u3067\u3059\u3002\u3064\u307e\u308a\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n[\u30d8\u30c3\u30c0\u30fc].[\u30da\u30a4\u30ed\u30fc\u30c9].[\u30d8\u30c3\u30c0\u30fc\u3068\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u3064\u306a\u3044\u3067\u7f72\u540d\u3057\u305f\u3082\u306e]\n<p>\u30d8\u30c3\u30c0\u30fc\u3001\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u305d\u308c\u305e\u308c\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30d8\u30c3\u30c0\u30fc<\/h2>\n<p>\u7f72\u540d\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u30c8\u30fc\u30af\u30f3\u306e\u30bf\u30a4\u30d7\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306aJSON\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>{ \r\n    \u201calg\u201d: \u201cHS256\u201d, \r\n    \u201ctyp\u201d: \u201cJWT\u201d\r\n}\r\n<\/pre>\n<p>\u3053\u308c\u306f\u7f72\u540d\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306fHS256\u3001\u30c8\u30fc\u30af\u306e\u30bf\u30a4\u30d7\u304cJSON Web Token\u3067\u3042\u308b\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002\u30c8\u30fc\u30af\u30f3\u306e\u30bf\u30a4\u30d7\u306f\u4ed6\u306b\u3082JWE(JSON Web Encryption)\u3068\u8a00\u3046\u3082\u306e\u304c\u3042\u308a\u3001\u3053\u308c\u306f\u6697\u53f7\u5316\u307e\u3067\u4ed5\u69d8\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u3057\u304b\u3057\u306a\u304c\u3089\u3001\u4eca\u56de\u306f\u6697\u53f7\u5316\u306f\u884c\u308f\u305a\u3001\u3042\u304f\u307e\u3067\u7f72\u540d\u3060\u3051\u3067\u3059\u306e\u3067\u3001SSL\u7b49\u3067\u6697\u53f7\u5316\u3059\u308b\u3053\u3068\u306f\u5fc5\u9808\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30da\u30a4\u30ed\u30fc\u30c9<\/h2>\n<p>JSON Web Token\u3067\u3084\u308a\u53d6\u308a\u3059\u308b\u30c7\u30fc\u30bf\u672c\u4f53\u3067\u3059\u3002\u4f8b\u3048\u3070\u30e6\u30fc\u30b6\u30fc\u540d\u3060\u3063\u305f\u308a\u3001\u8a8d\u53ef\u60c5\u5831\u3060\u3063\u305f\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u7531\u306b\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<pre>{ \r\n    \u201csub\u201d: \u201cntakei\u201d\r\n}\r\n<\/pre>\n<p>\u3053\u308c\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u304cntakei\u306e\u30c7\u30fc\u30bf\u306b\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3001\u4f55\u3067\u3082\u5b9a\u7fa9\u3057\u3066\u3044\u3044\u3068\u3044\u3046\u308f\u3051\u3067\u306f\u306a\u304f\u3001\u5e7e\u3064\u304b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u306fJSON Web Token\u306e\u4ed5\u69d8\u306b\u3088\u3063\u3066\u4e88\u7d04\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u8a73\u7d30\u306f<a href=\"https:\/\/tools.ietf.org\/html\/draft-ietf-oauth-json-web-token-19#section-4\">RFC<\/a>\u3092\u53c2\u7167\u9802\u3051\u308c\u3070\u308f\u304b\u308b\u306e\u3067\u3059\u304c\u3001\u4f8b\u3048\u3070\u3001exp\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u306f\u30c8\u30fc\u30af\u30f3\u306e\u6709\u52b9\u671f\u9650\u3068\u3057\u3066\u4f7f\u308f\u308c\u308b\u3053\u3068\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u4f7f\u3063\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u6b21\u306b\u3001\u30c8\u30fc\u30af\u30f3\u3092\u4f5c\u6210\u3059\u308b\u307e\u3067\u306e\u6d41\u308c\u3001\u305d\u3057\u3066\u305d\u306e\u30c8\u30fc\u30af\u30f3\u3092\u691c\u8a3c\u3059\u308b\u307e\u3067\u306e\u6d41\u308c\u3092\u8aac\u660e\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30c8\u30fc\u30af\u30f3\u4f5c\u6210\u306e\u6d41\u308c<\/h2>\n<p>\u30c8\u30fc\u30af\u30f3\u4f5c\u6210\u307e\u3067\u306e\u6d41\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-7580 size-full\" src=\"https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide1.png?resize=720%2C405&#038;ssl=1\" alt=\"Slide1\" width=\"720\" height=\"405\" srcset=\"https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide1.png?w=720&amp;ssl=1 720w, https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide1.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide1.png?resize=678%2C381&amp;ssl=1 678w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>(1) \u30d8\u30c3\u30c0\u30fc\u3092Base64 URL Encode<\/p>\n<p>\u30d8\u30c3\u30c0\u30fc\u3092Base64 URL Encode\u3057\u307e\u3059\u3002Base64 URL Encode\u3068\u306fBase64\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u305f\u4e0a\u3067\u3001\u66f4\u306b\u4ee5\u4e0b\u306e\u51e6\u7406\u3092\u65bd\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>+\u3092-\u306b\u7f6e\u63db<\/li>\n<li>\/\u3092_\u306b\u7f6e\u63db<\/li>\n<\/ul>\n<p>\u3053\u308c\u306fURL\u306b\u3001+\u3084\/\u3092\u4e57\u305b\u308b\u3068\u304a\u304b\u3057\u306a\u52d5\u4f5c\u3092\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u304b\u3089\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u500b\u4eba\u7684\u306b\u306f\u3001\u30c8\u30fc\u30af\u30f3\u3092URL\u306b\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u304b\u306a\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002\u5927\u62b5\u306f\u3001HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u306eAuthorization\u306b\u30bb\u30c3\u30c8\u3059\u308b\u306e\u304c\u666e\u901a\u306a\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f\u3067\u3082JSON Web Token\u306e\u4ed5\u69d8\u306a\u306e\u3067\u3001\u305d\u306e\u3068\u304a\u308a\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>(2) \u30da\u30a4\u30ed\u30fc\u30c9\u3092Base64 URL Encode<\/p>\n<p>\u30d8\u30c3\u30c0\u30fc\u3068\u540c\u69d8\u306b\u30da\u30a4\u30ed\u30fc\u30c9\u3082Base64 URL Encode\u3057\u307e\u3059\u3002<\/p>\n<p>(3)\u00a0HS256\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u306b\u3088\u308a\u7f72\u540d<\/p>\n<p>(1)\u3068(2)\u306e\u5024\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u3064\u306a\u3052\u3066\u3001\u305d\u306e\u5024\u306e\u30cf\u30c3\u30b7\u30e5\u5024(\u4e0d\u53ef\u9006\u3067\u3001\u305d\u306e\u5024\u304b\u3089\u306f\u3082\u3068\u306e\u5024\u304c\u985e\u63a8\u3067\u304d\u306a\u3044\u3082\u306e)\u3092\u6c42\u3081\u307e\u3059\u3002\u30cf\u30c3\u30b7\u30e5\u5024\u306f\u3001HS256\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u3001\u30b5\u30fc\u30d0\u30fc\u5074\u306b\u4fdd\u5b58\u3055\u308c\u305f\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u3067\u6c42\u3081\u307e\u3059\u3002\u3053\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u6c42\u3081\u308b\u3053\u3068\u3092\u7f72\u540d\u3068\u8a00\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u306e(1)\u3068(2)\u3068(3)\u3092\u305d\u308c\u305e\u308c\u30d4\u30ea\u30aa\u30c9\u3067\u3064\u306a\u3052\u305f\u3082\u306e\u304c\u3001\u6700\u7d42\u7684\u306b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u6e21\u3055\u308c\u308b\u30c8\u30fc\u30af\u30f3\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c8\u30fc\u30af\u30f3\u3092\u53d7\u3051\u53d6\u3063\u305f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u3001\u30e1\u30e2\u30ea\u306a\u308a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u308a\u30ed\u30fc\u30ab\u30eb\u30b9\u30c8\u30ec\u30fc\u30b8\u306a\u308a\u6c38\u7d9a\u5316\u3055\u308c\u308b\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u4fdd\u5b58\u3092\u3057\u3066\u3001\u8a8d\u8a3c\u3067\u4fdd\u8b77\u3055\u308c\u305f\u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u53d6\u5f97\u3057\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u6e21\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30c8\u30fc\u30af\u30f3\u3092\u691c\u8a3c\u3059\u308b\u307e\u3067\u306e\u6d41\u308c<\/h2>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u30c8\u30fc\u30af\u30f3\u3092\u53d7\u3051\u53d6\u3063\u305f\u30b5\u30fc\u30d0\u30fc\u304c\u3001\u3069\u3046\u3084\u3063\u3066\u8a8d\u8a3cOK\u3068\u5224\u65ad\u3059\u308b\u304b\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7583\" src=\"https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide2.png?resize=720%2C234&#038;ssl=1\" alt=\"Slide2\" width=\"720\" height=\"234\" srcset=\"https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide2.png?w=720&amp;ssl=1 720w, https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/Slide2.png?resize=300%2C98&amp;ssl=1 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>(1) HS256\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u306b\u3088\u308a\u7f72\u540d<br \/>\n\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30c8\u30fc\u30af\u30f3\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u533a\u5207\u3063\u3066\u3001\u5de6\u304b\u3089\u4e00\u3064\u76ee\u3068\u4e8c\u3064\u76ee(\u3064\u307e\u308a\u30d8\u30c3\u30c0\u30fc\u3068\u30da\u30a4\u30ed\u30fc\u30c9)\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u6c42\u3081\u307e\u3059\u3002\u6c42\u3081\u65b9\u306f\u3001\u5148\u307b\u3069\u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>(2) \u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u6bd4\u8f03<br \/>\n(1)\u3067\u6c42\u3081\u305f\u5024\u3068\u3001\u30c8\u30fc\u30af\u30f3\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u533a\u5207\u3063\u305f\u3082\u306e\u306e\u4e2d\u306e\u4e00\u756a\u53f3\u306e\u90e8\u5206(\u3064\u307e\u308a\u3001\u300c\u30c8\u30fc\u30af\u30f3\u4f5c\u6210\u306e\u6d41\u308c\u300d\u3067\u30d8\u30c3\u30c0\u30fc\u3068\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u7f72\u540d\u3057\u305f\u3082\u306e)\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u6bd4\u8f03\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u4e00\u81f4\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u8a8d\u8a3c\u60c5\u5831\u304c\u507d\u9020\u3082\u3057\u304f\u306f\u6539\u3056\u3093\u3055\u308c\u305f\u3082\u306e\u3068\u5224\u65ad\u3057\u3001\u8a8d\u8a3cNG\u3068\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u81ea\u5206\u3067\u3064\u304f\u3063\u3066\u307f\u308b<\/h2>\n<p>Linux\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u3001JSON Web Token\u306e\u4ed5\u69d8\u306b\u57fa\u3065\u3044\u305f\u30c8\u30fc\u30af\u30f3\u3092\u4f5c\u3063\u3066\u898b\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306aJSON\u304c\u3042\u308b\u3068\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u304b\u3089\u30c8\u30fc\u30af\u30f3\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d8\u30c3\u30c0\u30fc<\/p>\n<pre>{ \r\n    \u201calg\u201d: \u201cHS256\u201d, \r\n    \u201ctyp\u201d: \u201cJWT\u201d\r\n}\r\n<\/pre>\n<p>\u30da\u30a4\u30ed\u30fc\u30c9<\/p>\n<pre>{ \r\n    \u201csub\u201d: \u201cntakei\u201d\r\n}\r\n<\/pre>\n<p>\u307e\u305a\u30d8\u30c3\u30c0\u30fc\u3092Base64 URL Encode\u3057\u307e\u3059\u3002<\/p>\n<pre><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# echo -n '{&quot;alg&quot;:&quot;HS256&quot;,&quot;typ&quot;:&quot;JWT&quot;}' | base64 | sed s\/\\+\/-\/ | sed -e 's\/\\\/\/_\/' | sed -E s\/=+$\/\/\r\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\r\n<\/pre>\n<p>\u307e\u305abase64\u30b3\u30de\u30f3\u30c9\u3067base64\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u3001sed\u3067+\u3092-\u306b\u7f6e\u63db\u3001\u3055\u3089\u306bsed\u3067\/\u3092_\u306b\u7f6e\u63db\u3001\u3055\u3089\u306bsed\u3067Base64\u306e\u6700\u5f8c\u306b\u4ed8\u52a0\u3055\u308c\u308b=\u306e\u30d1\u30c7\u30a3\u30f3\u30b0\u6587\u5b57\u5217\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u540c\u69d8\u306b\u3001\u30da\u30a4\u30ed\u30fc\u30c9\u3082Base64 URL Encode\u3057\u307e\u3059\u3002<\/p>\n<pre><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# echo -n '{\u201csub\u201d:\u201cntakei\u201d}' | base64 | sed s\/\\+\/-\/ | sed -e 's\/\\\/\/_\/' | sed -E s\/=+$\/\/\r\ne-KAnHN1YuKAnTrigJxudGFrZWnigJ19\r\n<\/pre>\n<p>\u6b21\u306b\u30d8\u30c3\u30c0\u30fc\u3068\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u3064\u306a\u3052\u305f\u3082\u306e\u3092\u3001HS256\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc(\u3053\u3053\u3067\u306fsecret)\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u6c42\u3081\u307e\u3059\u3002<\/p>\n<pre><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# echo -n 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e-KAnHN1YuKAnTrigJxudGFrZWnigJ19'  | openssl dgst -sha256 -hmac secret\r\n97763576b44cbadea825195aa610b3b9ce71a52f228f3a2b41eba30e7e8350ad\r\n<\/pre>\n<p>\u4eca\u307e\u3067\u306e\u904e\u7a0b\u3067\u5f97\u3089\u308c\u305f3\u3064\u306e\u5024\u3092\u30d4\u30ea\u30aa\u30c9\u3067\u3064\u306a\u3052\u307e\u3059\u3002<\/p>\n<pre>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e-KAnHN1YuKAnTrigJxudGFrZWnigJ19.97763576b44cbadea825195aa610b3b9ce71a52f228f3a2b41eba30e7e8350ad\r\n<\/pre>\n<p>\u3053\u308c\u304cJSON Web Token\u306e\u4ed5\u69d8\u306b\u5f93\u3063\u305f\u30c8\u30fc\u30af\u30f3\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<!-- Anyway Feedback Container \/\/-->\n<div class=\"afb_container\" id=\"afb-container-post-7576\">\u3054\u89a7\u3044\u305f\u3060\u304d\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01\r\n\r\n<span class=\"message\">\u3053\u306e\u6295\u7a3f\u306f\u304a\u5f79\u306b\u7acb\u3061\u307e\u3057\u305f\u304b\uff1f<\/span>\r\n<br \/>\r\n<br \/>\r\n<a class=\"good\" href=\"#afb-post-7576\">\u5f79\u306b\u7acb\u3063\u305f<\/a>\r\n<a class=\"bad\" href=\"#afb-post-7576\">\u5f79\u306b\u7acb\u305f\u306a\u304b\u3063\u305f<\/a>\r\n<br \/>\r\n<br \/>\r\n<span>10\u4eba\u304c\u3053\u306e\u6295\u7a3f\u306f\u5f79\u306b\u7acb\u3063\u305f\u3068\u8a00\u3063\u3066\u3044\u307e\u3059\u3002<\/span><input type=\"hidden\" name=\"post_type\" value=\"post\" \/>\n<input type=\"hidden\" name=\"object_id\" value=\"7576\" \/>\n<\/div>\n<!-- \/\/Anyway Feedback Container -->","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u30b5\u30a4\u30aa\u30b9\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u6280\u8853\u90e8\u306e\u6b66\u4e95\u3067\u3059\u3002 \u4eca\u56de\u306f\u3001JSON Web Token\u306e\u4ed5\u69d8\u306b\u5f93\u3063\u305f\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092Linux\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u305d\u306e\u524d\u306b\u3001JSON Web Token\u3092\u8aac\u660e &#8230; <\/p>\n","protected":false},"author":6,"featured_media":10597,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[299,459],"tags":[217],"class_list":{"0":"post-7576","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-auth","8":"category-takei","9":"tag-oauth","10":"entry"},"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/tech-lab.sios.jp\/wp-content\/uploads\/2017\/12\/chain_saw.png?fit=800%2C689&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/posts\/7576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/comments?post=7576"}],"version-history":[{"count":9,"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/posts\/7576\/revisions"}],"predecessor-version":[{"id":25106,"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/posts\/7576\/revisions\/25106"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/media\/10597"}],"wp:attachment":[{"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/media?parent=7576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/categories?post=7576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech-lab.sios.jp\/wp-json\/wp\/v2\/tags?post=7576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}