{"id":1081,"date":"2024-08-03T23:56:05","date_gmt":"2024-08-03T16:56:05","guid":{"rendered":"https:\/\/thoaicoder.com\/?p=1081"},"modified":"2024-08-09T23:29:49","modified_gmt":"2024-08-09T16:29:49","slug":"jwt-signing-algorithms","status":"publish","type":"post","link":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/","title":{"rendered":"JWT signing algorithms"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">1. The need of JWT signatures<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">JWT (JSON Web Token) is a compact, URL-safe means of representing claims to be transferred between two parties (we can call them are client and server). In today&#8217;s landscape, with the advancement of microservices, there can be multiple services on the server side, an identity service issues JWT and other services use this JWT to perform authentication\/authorization.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A JWT consists of three parts:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Header<\/strong>: Specifies the token type (JWT) and the signing algorithm (e.g., HS256).<\/li>\n\n\n\n<li><strong>Payload<\/strong>: Contains the claims or assertions about an entity (e.g., user data).<\/li>\n\n\n\n<li><strong>Signature<\/strong>: Verifies the token&#8217;s integrity and authenticity.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">When a JWT is created, it is signed. But why do we need this signature? Let&#8217;s consider an example about a file management system with two services: <strong>Identity Service<\/strong> &#8211; handle user login and issue JWT token, <strong>File Management Service<\/strong> &#8211; perform all operations about files (read, write, delete, share) authorized based on the JWT sent by client.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"363\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-1.png\" alt=\"\" class=\"wp-image-1096\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-1.png 650w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-1-300x168.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We use a <strong>&#8220;permissions&#8221;<\/strong> claim in JWT payload to store user&#8217;s permission. Let&#8217;s have a look at a sample JWT which is decoded by jwt.io.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1001\" height=\"729\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-3.png\" alt=\"\" class=\"wp-image-1098\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-3.png 1001w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-3-300x218.png 300w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-3-768x559.png 768w\" sizes=\"auto, (max-width: 1001px) 100vw, 1001px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The payload are encoded so they can be created easily, the hacker can easily add <strong>&#8220;share&#8221;<\/strong> permission into this claim then create another JWT token to send malicious requests. So we need a mechanism overcome this scenario, it is signature.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">2. How does JWT signature work?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">When creating a JWT, the signature is then created by hashing header and payload with a <strong>secret key<\/strong> using a specified algorithm e.g. HS256.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-tangaroa-background-color has-text-color has-background has-link-color wp-elements-1\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)\"><code>HS256(\n  base64UrlEncode(header) + \".\" + base64UrlEncode(payload),\n  secret\n)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When verifying a JWT, the server will also create a signature from header and payload then compare with the signature in the JWT, the JWT is verified only these signature are the same. This solution ensures that the content of the JWT (the header and payload) has not been tampered with.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>If any part of the token is altered after it has been signed, the signature will not match when the token is verified<\/strong> <em>(with our file management sample above, the file management service will reject the JWT which was modified to add <strong>&#8220;share&#8221;<\/strong> permission into).<\/em> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-4-1024x480.png\" alt=\"\" class=\"wp-image-1112\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-4-1024x480.png 1024w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-4-300x141.png 300w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-4-768x360.png 768w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/anh-4.png 1126w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">3. RS256 and HS256 algorithms<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">RS256 and HS256 are commonly used algorithms for signing and verifying JSON Web Tokens (JWTs). They serve different purposes depending on the use case and security requirements. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>HS256 (HMAC with SHA-256)<\/strong> is a <strong>symmetric <\/strong>algorithm, meaning it uses the same secret key for both signing the token and verifying its signature. This approach requires the key to be securely shared between the parties involved, which can be a potential security risk if not managed properly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the other hand, <strong>RS256 (RSA with SHA-256)<\/strong> is an <strong>asymmetric <\/strong>algorithm that uses a pair of keys: a private key for signing the token and a public key for verifying it. The private key remains confidential, while the public key can be distributed openly. This method is more secure in scenarios where the verifier and the signer are different entities, as the public key can be shared without compromising the security of the private key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will create a Java application to demonstrate how they work using jjwt library. This application uses the hardcore keys but in real work, we must store them in environment variables or configuration files. You can find the source code of this application including unit tests <a href=\"https:\/\/github.com\/ThoaiNguyenHuu842\/jwt_signature_algorithms\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.1. HS256<\/h2>\n\n\n\n<pre class=\"wp-block-code has-white-color has-tangaroa-background-color has-text-color has-background has-link-color wp-elements-2\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)\"><code>public class JwtHs256Service {\n  private static String SECRET_KEY = \"oeRaYY7W...\";\n\n  public String createJWT(String id, String issuer, String subject, List&lt;String&gt; permissions, long ttlMillis) {\n    SecretKey key = Keys.hmacShaKeyFor(SECRET_KEY.getBytes(StandardCharsets.UTF_8));\n    long nowMillis = System.currentTimeMillis();\n    long expMillis = nowMillis + ttlMillis;\n    Date exp = new Date(expMillis);\n    JwtBuilder b = Jwts.builder()\n      .id(id)\n      .issuer(issuer)\n      .subject(subject)\n      .claim(\"permissions\", permissions)\n      .expiration(exp);\n    return b.signWith(key, SIG.HS256).compact();\n  }\n\n  public Claims decodeJWT(String jwt) {\n    SecretKey key = Keys.hmacShaKeyFor(SECRET_KEY.getBytes(StandardCharsets.UTF_8));\n    JwtParser parser = Jwts.parser().verifyWith(key).build();\n    Jws&lt;Claims&gt; claims = parser.parseSignedClaims(jwt);\n    return claims.getPayload();\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3.2. RS256<\/h2>\n\n\n\n<pre class=\"wp-block-code has-white-color has-tangaroa-background-color has-text-color has-background has-link-color wp-elements-3\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)\"><code>public class JwtRs256Service {\n  private static KeyPair keyPair = Jwts.SIG.RS256.keyPair().build();\n\n  public String createJWT(String id, String issuer, String subject, List&lt;String&gt; permissions, long ttlMillis) {\n    SignatureAlgorithm alg = SIG.RS256;\n    long nowMillis = System.currentTimeMillis();\n    long expMillis = nowMillis + ttlMillis;\n    Date exp = new Date(expMillis);\n    JwtBuilder b = Jwts.builder()\n      .id(id)\n      .issuer(issuer)\n      .subject(subject)\n      .claim(\"permissions\", permissions)\n      .expiration(exp);\n    return b.signWith(keyPair.getPrivate(), SIG.RS256).compact();\n  }\n\n  public Claims decodeJWT(String jwt) {\n    JwtParser parser = Jwts.parser().verifyWith(keyPair.getPublic()).build();\n    Jws&lt;Claims&gt; claims = parser.parseSignedClaims(jwt);\n    return claims.getPayload();\n  }\n}<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">4. Conclusion<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In conclusion, understanding JWT signing algorithms is essential for secure authentication in web applications. HS256, a symmetric algorithm, uses a single secret key for both signing and verification, making it suitable for scenarios where the token issuer and verifier are the same entity. In contrast, RS256, an asymmetric algorithm, uses a private key for signing and a public key for verification, ideal for distributed systems where multiple parties need to verify tokens. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Choosing the right algorithm depends on your application&#8217;s architecture and security requirements, ensuring the integrity and authenticity of your tokens.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. The need of JWT signatures JWT (JSON Web Token) is a compact, URL-safe means [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1082,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.14 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JWT signing algorithms - I \u2764 Code<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JWT signing algorithms - I \u2764 Code\" \/>\n<meta property=\"og:description\" content=\"1. The need of JWT signatures JWT (JSON Web Token) is a compact, URL-safe means [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/\" \/>\n<meta property=\"og:site_name\" content=\"I \u2764 Code\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-03T16:56:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-09T16:29:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/Screenshot-2023-07-09-221006.png\" \/>\n\t<meta property=\"og:image:width\" content=\"797\" \/>\n\t<meta property=\"og:image:height\" content=\"393\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Thoai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/\"},\"author\":{\"name\":\"Thoai\",\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"headline\":\"JWT signing algorithms\",\"datePublished\":\"2024-08-03T16:56:05+00:00\",\"dateModified\":\"2024-08-09T16:29:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/\"},\"wordCount\":652,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/\",\"url\":\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/\",\"name\":\"JWT signing algorithms - I \u2764 Code\",\"isPartOf\":{\"@id\":\"https:\/\/thoaicoder.com\/#website\"},\"datePublished\":\"2024-08-03T16:56:05+00:00\",\"dateModified\":\"2024-08-09T16:29:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/thoaicoder.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JWT signing algorithms\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/thoaicoder.com\/#website\",\"url\":\"https:\/\/thoaicoder.com\/\",\"name\":\"I \u2764 Code\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/thoaicoder.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\",\"name\":\"Thoai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg\",\"contentUrl\":\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg\",\"width\":640,\"height\":640,\"caption\":\"Thoai\"},\"logo\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/thoaicoder.com\",\"https:\/\/www.linkedin.com\/in\/huu-thoai-nguyen\/\"],\"url\":\"https:\/\/thoaicoder.com\/index.php\/author\/admin_cvyxq4b8\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JWT signing algorithms - I \u2764 Code","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:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/","og_locale":"en_US","og_type":"article","og_title":"JWT signing algorithms - I \u2764 Code","og_description":"1. The need of JWT signatures JWT (JSON Web Token) is a compact, URL-safe means [&hellip;]","og_url":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/","og_site_name":"I \u2764 Code","article_published_time":"2024-08-03T16:56:05+00:00","article_modified_time":"2024-08-09T16:29:49+00:00","og_image":[{"width":797,"height":393,"url":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2024\/08\/Screenshot-2023-07-09-221006.png","type":"image\/png"}],"author":"Thoai","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Thoai","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#article","isPartOf":{"@id":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/"},"author":{"name":"Thoai","@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"headline":"JWT signing algorithms","datePublished":"2024-08-03T16:56:05+00:00","dateModified":"2024-08-09T16:29:49+00:00","mainEntityOfPage":{"@id":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/"},"wordCount":652,"commentCount":0,"publisher":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/","url":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/","name":"JWT signing algorithms - I \u2764 Code","isPartOf":{"@id":"https:\/\/thoaicoder.com\/#website"},"datePublished":"2024-08-03T16:56:05+00:00","dateModified":"2024-08-09T16:29:49+00:00","breadcrumb":{"@id":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thoaicoder.com\/index.php\/2024\/08\/03\/jwt-signing-algorithms\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thoaicoder.com\/"},{"@type":"ListItem","position":2,"name":"JWT signing algorithms"}]},{"@type":"WebSite","@id":"https:\/\/thoaicoder.com\/#website","url":"https:\/\/thoaicoder.com\/","name":"I \u2764 Code","description":"","publisher":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thoaicoder.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720","name":"Thoai","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/","url":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg","contentUrl":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg","width":640,"height":640,"caption":"Thoai"},"logo":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/thoaicoder.com","https:\/\/www.linkedin.com\/in\/huu-thoai-nguyen\/"],"url":"https:\/\/thoaicoder.com\/index.php\/author\/admin_cvyxq4b8\/"}]}},"_links":{"self":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/1081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/comments?post=1081"}],"version-history":[{"count":22,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/1081\/revisions"}],"predecessor-version":[{"id":1122,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/1081\/revisions\/1122"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/media\/1082"}],"wp:attachment":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/media?parent=1081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/categories?post=1081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/tags?post=1081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}