{"id":6733,"date":"2023-08-23T09:29:11","date_gmt":"2023-08-23T09:29:11","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=6733"},"modified":"2023-08-23T09:50:15","modified_gmt":"2023-08-23T09:50:15","slug":"django-rest-framework-jwt","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/django-tutorial\/django-rest-framework-jwt\/","title":{"rendered":"Django REST Framework JWT"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use JSON Web Token (JWT) authentication for RESTful API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='what-is-jwt'>What is JWT <a href=\"#what-is-jwt\" class=\"anchor\" id=\"what-is-jwt\" title=\"Anchor for What is JWT\">#<\/a><\/h2>\n\n\n\n<p>Suppose you have a secret code that both you and your friend use to exchange messages. This code allows your friend to trust that the messages are really from you. This is because only you and your friend know the code. In the Web API world, JWT (JSON Web Token) works in a similar fashion.<\/p>\n\n\n\n<p>JWT is like a digital &#8220;ID Card&#8221; that client and server use to verify identity without needing to store sensitive information such as username\/password. JWT allows client and server securely share information between client and server.<\/p>\n\n\n\n<p>Imagine you&#8217;re logging into a mobile app. After you enter a valid username and password, the server creates a JWT for you.<\/p>\n\n\n\n<p>The JWT includes your user id and may also contain other information. The server sends JWT back to your mobile app.<\/p>\n\n\n\n<p>Whenever you want to access a protected part of the app, you present this JWT. The server checks the signature to verify its authenticity and reads the information to identify who you are and what you can access<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='jwt-token-structure'>JWT token structure <a href=\"#jwt-token-structure\" class=\"anchor\" id=\"jwt-token-structure\" title=\"Anchor for JWT token structure\">#<\/a><\/h3>\n\n\n\n<p>JWT token has the following structure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Header &#8211; the header includes the type of token i.e., JWT, and the signing algorithm being used.<\/li>\n\n\n\n<li>Payload &#8211; this is where JWT stores specific information such as user id, expiration time, etc. Think of it like the personal details of your ID card.<\/li>\n\n\n\n<li>Signature &#8211; the signature is created using the header, payload, and a secret key that only the server knows. This ensures that the information in the token is not tampered with. <\/li>\n<\/ul>\n\n\n\n<p>For example, the following shows a JWT token:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9<\/span><span class=\"hljs-selector-class\">.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjkyNzc4MzQxLCJpYXQiOjE2OTI3NzgwNDEsImp0aSI6IjljODVmMTU4MzIzMzQwOTViYTkxZTNlM2Q2MDA0MWU3IiwidXNlcl9pZCI6MX0<\/span><span class=\"hljs-selector-class\">.Y1uOK_rxp6_kvDmuULxc82kXgKZPrWsTuLh0Wvg3_Cs<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If you copy the token to the encoded part of the jwt.io website, you&#8217;ll see three parts of its structure:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"581\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/jwtio-1024x581.png\" alt=\"\" class=\"wp-image-6737\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/jwtio-1024x581.png 1024w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/jwtio-300x170.png 300w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/jwtio-768x436.png 768w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/jwtio.png 1327w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you modify the JWT token (adding or removing characters), the app will validate the signature and show the result:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"765\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/invalid-jwt-token.png\" alt=\"\" class=\"wp-image-6738\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/invalid-jwt-token.png 666w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/invalid-jwt-token-261x300.png 261w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='integrating-jwt-in-the-django-rest-framework-application'>Integrating JWT in the Django REST Framework application <a href=\"#integrating-jwt-in-the-django-rest-framework-application\" class=\"anchor\" id=\"integrating-jwt-in-the-django-rest-framework-application\" title=\"Anchor for Integrating JWT in the Django REST Framework application\">#<\/a><\/h2>\n\n\n\n<p>First, install the package <code>djangorestframework-simplejwt<\/code> in the current virtual environment:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">pip install djangorestframework-simplejwt<\/code><\/span><\/pre>\n\n\n<p>Second, add the <code>rest_framework_simplejwt<\/code> to the <code>INSTALLED_APPS<\/code> of the <code>settings.py<\/code> file of the project:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">INSTALLED_APPS = &#91;\r\n    ...,\n    <span class=\"hljs-string\">'rest_framework_simplejwt'<\/span>,\n    ...\r\n]<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, configure the project to use the library by adding the <code>rest_framework_simplejwt.authentication.JWTAuthentication<\/code>\u00a0to the list of authentication classes in the <code>settings.py<\/code> file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">REST_FRAMEWORK = {\r\n    ...\r\n    <span class=\"hljs-string\">'DEFAULT_AUTHENTICATION_CLASSES'<\/span>: (\r\n        ...\r\n        <span class=\"hljs-string\">'rest_framework_simplejwt.authentication.JWTAuthentication'<\/span>,\r\n    )\r\n    ...\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Fourth, import two views <code>TokenObtainPairView<\/code> and <code>TokenRefreshView<\/code> from <code>rest_framework_simplejwt.views<\/code> into the <code>urls.py<\/code> of the project and configure two API endpoints respectively:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">from<\/span> django.contrib <span class=\"hljs-keyword\">import<\/span> admin\r\n<span class=\"hljs-keyword\">from<\/span> django.urls <span class=\"hljs-keyword\">import<\/span> path, include\r\n\r\n<span class=\"hljs-comment\"># jwt<\/span>\r\n<span class=\"hljs-keyword\">from<\/span> rest_framework_simplejwt.views <span class=\"hljs-keyword\">import<\/span> (\r\n    TokenObtainPairView,\r\n    TokenRefreshView,\r\n)\r\n\r\nurlpatterns = &#91;\r\n    path(<span class=\"hljs-string\">'admin\/'<\/span>, admin.site.urls),\r\n    path(<span class=\"hljs-string\">'api\/v1\/'<\/span>, include(<span class=\"hljs-string\">'api.urls'<\/span>)),\r\n    path(<span class=\"hljs-string\">\"auth\/\"<\/span>, include(<span class=\"hljs-string\">\"rest_framework.urls\"<\/span>)),\r\n\n    <span class=\"hljs-comment\"># jwt<\/span>\r\n    path(<span class=\"hljs-string\">'api\/v1\/token\/'<\/span>, TokenObtainPairView.as_view(), name=<span class=\"hljs-string\">'token_obtain_pair'<\/span>),\r\n    path(<span class=\"hljs-string\">'api\/v1\/token\/refresh\/'<\/span>, TokenRefreshView.as_view(), name=<span class=\"hljs-string\">'token_refresh'<\/span>),\r\n]<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The endpoint <code>api\/v1\/token\/<\/code> allows you to post a valid username and password to obtain a pair of tokens:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Access token<\/li>\n\n\n\n<li>Refresh token<\/li>\n<\/ul>\n\n\n\n<p>Once having the access token, you can add it to the header of an HTTP request to call other APIs. When the access token is expired, you can call the <code>api\/v1\/token\/refresh\/<\/code> API endpoint to get the new access token.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='getting-tokens'>Getting tokens <a href=\"#getting-tokens\" class=\"anchor\" id=\"getting-tokens\" title=\"Anchor for Getting tokens\">#<\/a><\/h3>\n\n\n\n<p>To get a pair of tokens, you need to log in using a valid username and password. Open the <code>api\/v1\/token\/<\/code> endpoint in the web browser, you&#8217;ll see the following page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"847\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-obtain-tokens.png\" alt=\"\" class=\"wp-image-6734\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-obtain-tokens.png 714w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-obtain-tokens-253x300.png 253w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/figure>\n\n\n\n<p>Once you enter a valid username and password and click the POST button: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"331\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-jwt-login.png\" alt=\"\" class=\"wp-image-6736\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-jwt-login.png 700w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-jwt-login-300x142.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p>you&#8217;ll get the following response:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">HTTP 200 OK\r\nAllow: POST, OPTIONS\r\nContent-Type: application\/json\r\nVary: Accept\r\n\r\n{\r\n    \"refresh\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY5Mjg2NDQ0MSwiaWF0IjoxNjkyNzc4MDQxLCJqdGkiOiJhM2E2MTcyYjZmYjY0YzFlOGJjZGUyMDQ0MjgyNDkwZCIsInVzZXJfaWQiOjF9.8WxI_HcKkm5z6Gx3kCPzpNIkx4nBP52tdiw7-GJv9tA\",\r\n    \"access\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjkyNzc4MzQxLCJpYXQiOjE2OTI3NzgwNDEsImp0aSI6IjljODVmMTU4MzIzMzQwOTViYTkxZTNlM2Q2MDA0MWU3IiwidXNlcl9pZCI6MX0.Q_-5AqFxbo1n2sQOOfcdd6ly8XFVT8wJNE-2TQph2ac\"\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, you can use the access token to call other APIs without the need of providing the username\/password again.<\/p>\n\n\n\n<p>For example, we can use Postman to call the API with the endpoint <code>api\/v1\/todos\/<\/code> to get all the todos as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"694\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-access-token-1024x694.png\" alt=\"\" class=\"wp-image-6735\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-access-token-1024x694.png 1024w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-access-token-300x203.png 300w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-access-token-768x520.png 768w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-access-token.png 1069w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It returns the todos of the user whose username is <code>John<\/code>, which is the one that we use to log in to get the tokens.<\/p>\n\n\n\n<p>When the access token is expired, you need to call the API endpoint <code>\/api\/v1\/token\/refresh\/<\/code> with the refresh token to get the new access token.<\/p>\n\n\n\n<p>Open the endpoint <code>\/api\/v1\/token\/refresh\/<\/code> on the web browser, and enter the refresh token, click the POST button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"919\" height=\"803\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-jwt-refresh-token.png\" alt=\"\" class=\"wp-image-6739\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-jwt-refresh-token.png 919w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-jwt-refresh-token-300x262.png 300w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/django-rest-framework-jwt-refresh-token-768x671.png 768w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><\/figure>\n\n\n\n<p>I&#8217;ll return you a new access token:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">HTTP <span class=\"hljs-number\">200<\/span> OK\r\n<span class=\"hljs-attr\">Allow<\/span>: POST, OPTIONS\r\nContent-Type: application\/json\r\n<span class=\"hljs-attr\">Vary<\/span>: Accept\r\n\r\n{\r\n    <span class=\"hljs-string\">\"access\"<\/span>: <span class=\"hljs-string\">\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjkyNzgzMDk0LCJpYXQiOjE2OTI3NzgwNDEsImp0aSI6IjFiNGRiYjgzZjRhMzRkYTlhMTgzNTY0MzY5M2MxNmQ0IiwidXNlcl9pZCI6MX0.lJeACjeegwoK_SE1NpmXBvKLNEvmahER8Eq-pZ71g7I\"<\/span>\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>And you can use the new access token to access to protected part of the application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='download-the-project-source-code'>Download the project source code <a href=\"#download-the-project-source-code\" class=\"anchor\" id=\"download-the-project-source-code\" title=\"Anchor for Download the project source code\">#<\/a><\/h2>\n\n\n\n<p>Click the following link to download the project source code:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/08\/todolist4.zip\">Download the project source code.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>JWT stands for JSON web token.<\/li>\n\n\n\n<li>JWT provides a secure way that allows server and client securely exchange information.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"6733\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/django-tutorial\/django-rest-framework-jwt\/\"\n\t\t\t\tdata-post-title=\"Django REST Framework JWT\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"6733\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/django-tutorial\/django-rest-framework-jwt\/\"\n\t\t\t\tdata-post-title=\"Django REST Framework JWT\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to use JSON Web Token (JWT) authentication for RESTful API.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5531,"menu_order":41,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6733","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/6733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=6733"}],"version-history":[{"count":0,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/6733\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/5531"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=6733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}