text: (window.webpackJsonp=window.webpackJsonp||[]).push([[134],{338:function(e,t,n){"use strict";n.r(t);var a=n(0),s=Object(a.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"json-web-token"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#json-web-token"}},[e._v("#")]),e._v(" JSON WEB TOKEN")]),e._v(" "),n("p",[e._v("Link: "),n("a",{attrs:{href:"https://jwt.io/introduction/",target:"_blank",rel:"noopener noreferrer"}},[e._v("jwt"),n("OutboundLink")],1)]),e._v(" "),n("h2",{attrs:{id:"what-is-json-web-token"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#what-is-json-web-token"}},[e._v("#")]),e._v(" What is JSON Web Token ?")]),e._v(" "),n("pre",[n("code",[e._v("JSON WEB TOKEN (JWT) \n")])]),e._v(" "),n("h2",{attrs:{id:"what-is-the-json-web-token-structure"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#what-is-the-json-web-token-structure"}},[e._v("#")]),e._v(" What is the JSON Web Token structure ?")]),e._v(" "),n("pre",[n("code",[e._v('In its compact form, JSON Web Tokens consist of three parts separated by dots (.)\n    - Header\n    - Payload\n    - Signature\n result:  xxxxx.yyyyy.zzzz\n\n* Header\n  typically consists of two parts: the type of the token, which is JWT\n      and the signing algorithm being used, such as RSA HMAC etc.\n  Example:\n      ```json\n      {\n          "alg": "HS256",\n          "typ": "JWT"\n      }\n      ```\n  Then, this JSON is Base64Url encoded to form the first part of the JWT.\n  \n* Payload\n  the second part of the token is the payload, which contains the claims.\n  Claims are statements about en entity(typically, the user) and additional\n  data.\n  There are three types of claims: registered, public, and private claims\n  \n  Example: \n      {\n          "aub": "xxx",\n          "name": "mmm",\n          "admin": false\n      }\n  The payload is then Base64Url encoded to form the second part of the JSON Web Token.\n\n* Signature\n    To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that.\n    \n    Example:\n      HMACSHA256(\n        base64UrlEncode(header) + "." +\n        base64UrlEncode(payload),\n        secret)\n        \n* Put all togethre\n    The output is three Base64-URL strings separated by dots \n    that can be easily passed in HTML and HTTP environments, \n    while being more compact when compared to XML-based standards\n    such as SAML.\n')])])])}),[],!1,null,null,null);t.default=s.exports}}]);