{"id":23366,"date":"2021-06-19T16:27:01","date_gmt":"2021-06-19T11:57:01","guid":{"rendered":"https:\/\/maktabkhooneh.org\/mag\/?p=23366"},"modified":"2026-02-09T19:06:04","modified_gmt":"2026-02-09T15:36:04","slug":"jwt-in-django","status":"publish","type":"post","link":"https:\/\/maktabkhooneh.org\/mag\/jwt-in-django\/","title":{"rendered":"JWT \u062f\u0631 \u062c\u0646\u06af\u0648"},"content":{"rendered":"\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u062f\u0627\u0634\u062a\u0646 \u0633\u06cc\u0633\u062a\u0645 Authentication \u062d\u06cc\u0646 \u0633\u0627\u062e\u062a API \u0627\u0632 \u0686\u0646\u062f \u0631\u0648\u0634 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u060c \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062b\u0627\u0644 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0628\u0647 \u0633\u06cc\u0633\u062a\u0645 \u062a\u0648\u06a9\u0646 \u062e\u0648\u062f Django Rest Framework \u06cc\u0627 \u0633\u06cc\u0633\u062a\u0645 <strong>JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/strong> \u0627\u0634\u0627\u0631\u0647 \u06a9\u0631\u062f. JWT \u062f\u0631 \u0648\u0627\u0642\u0639 \u0645\u062e\u0641\u0641 \u06a9\u0644\u0645\u0627\u062a JSON Web Token \u0628\u0648\u062f\u0647 \u0648 \u06cc\u06a9 JSON \u0633\u0627\u062f\u0647 \u0627\u0633\u062a. \u0628\u0631\u0627\u06cc \u06a9\u0633\u0628 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u06cc\u0634\u062a\u0631 \u062f\u0631 \u0627\u06cc\u0646 \u0631\u0627\u0628\u0637\u0647 \u062a\u0627 \u067e\u0627\u06cc\u0627\u0646 \u0627\u06cc\u0646 \u0646\u0648\u0634\u062a\u0647 \u0627\u0632 \u062f\u0633\u062a\u0647 <a href=\"https:\/\/maktabkhooneh.org\/learn\/python\/\">\u0622\u0645\u0648\u0632\u0634 \u067e\u0627\u06cc\u062a\u0648\u0646<\/a> \u0628\u0627 \u0645\u0627 \u0647\u0645\u0631\u0627\u0647 \u0628\u0627\u0634\u06cc\u062f.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\"><strong>JWT \u062f\u0631 \u062c\u0646\u06af\u0648 \u0686\u06cc\u0633\u062a\u061f<\/strong><\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0637\u0628\u0642 JWT\u060c RFC 7519 \u06cc\u06a9 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u0628\u0627\u0632 \u0628\u0631\u0627\u06cc \u0627\u0646\u062a\u0642\u0627\u0644 \u0627\u0645\u0646 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u06cc\u0627\u0646 \u0637\u0631\u0641\u06cc\u0646 \u0648 \u0628\u0647 \u0635\u0648\u0631\u062a \u06cc\u06a9 \u0634\u06cc JSON \u0631\u0627\u0647 \u0627\u0645\u0646 \u0648 \u062c\u0627\u0645\u0639\u06cc \u0631\u0627 \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0628\u062d\u062b \u0627\u0645\u0636\u0627\u06cc \u062f\u06cc\u062c\u06cc\u062a\u0627\u0644 \u067e\u06cc\u0634 \u0622\u0645\u062f\u0647 \u0648 \u0628\u0627\u06cc\u062f \u0628\u06af\u0648\u06cc\u06cc\u0645 \u06a9\u0647 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 JWT\u0647\u0627 \u0631\u0627 \u062a\u0648\u0633\u0637 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 RSA \u06cc\u0627 ECDSA \u0628\u0627 \u06cc\u06a9 \u06a9\u0644\u06cc\u062f \u062e\u0635\u0648\u0635\u06cc \/\u0639\u0645\u0648\u0645\u06cc \u0627\u0645\u0636\u0627 \u06a9\u0631\u062f. JWT\u0647\u0627 \u062f\u0631 \u0634\u06a9\u0644 \u0645\u062a\u0631\u0627\u06a9\u0645 \u062e\u0648\u062f \u062f\u0627\u0631\u0627\u06cc \u0633\u0647 \u0628\u062e\u0634 \u0647\u062f\u0631 (Header)\u060c Payload \u0648 \u0627\u0645\u0636\u0627 (Signature) \u0647\u0633\u062a\u0646\u062f \u06a9\u0647 \u0628\u0627 \u0646\u0642\u0637\u0647 (.) \u0627\u0632 \u06cc\u06a9\u062f\u06cc\u06af\u0631 \u062c\u062f\u0627 \u0645\u06cc\u200c\u0634\u0648\u0646\u062f.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" width=\"400\" height=\"277\" src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/6-1.jpg\" alt=\"JWT \u062f\u0631 \u062c\u0646\u06af\u0648\" class=\"wp-image-23372\" title=\"\" srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/6-1.jpg 400w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/6-1-300x208.jpg 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0646\u062d\u0648\u0647 \u06a9\u0627\u0631 JWT<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u0632 \u062c\u0645\u0644\u0647 \u0645\u0647\u0645\u200c\u062a\u0631\u06cc\u0646 \u0627\u0635\u0648\u0644 \u067e\u0634\u062a \u067e\u0631\u062f\u0647 \u0637\u0631\u0627\u062d\u06cc \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062c\u0646\u06af\u0648 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0628\u0647 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u0646\u0633\u0628\u06cc \u0645\u0648\u0644\u0641\u0647\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0627\u06cc\u0646 \u0686\u0627\u0631\u0686\u0648\u0628\u060c \u06a9\u062f\u0646\u0648\u06cc\u0633\u06cc \u06a9\u0645\u062a\u0631\u060c \u0627\u0635\u0644 \u0639\u062f\u0645 \u062a\u06a9\u0631\u0627\u0631\u060c \u062a\u0648\u0633\u0639\u0647 \u0633\u0631\u06cc\u0639 \u0648 \u0637\u0631\u0627\u062d\u06cc \u062a\u0645\u06cc\u0632 \u0627\u0634\u0627\u0631\u0647 \u06a9\u0631\u062f. \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0627\u06af\u0631 \u062f\u0631 \u0627\u0628\u062a\u062f\u0627\u06cc \u0645\u0633\u06cc\u0631 \u0647\u0633\u062a\u06cc\u062f \u06cc\u0627 \u062d\u062a\u06cc \u062c\u0632 \u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\u200c\u0647\u0627\u06cc \u062e\u0648\u0628 \u0627\u06cc\u0646 \u0631\u0627\u0647 \u0647\u0633\u062a\u06cc\u062f\u060c \u06cc\u0627\u062f\u06af\u06cc\u0631\u06cc \u062c\u0646\u06af\u0648 \u0628\u0647 \u0634\u0645\u0627 \u062f\u06cc\u062f \u0628\u0647\u062a\u0631 \u0648 \u0645\u0646\u0637\u0642\u06cc \u0645\u06cc\u200c\u062f\u0647\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u067e\u0633 \u0627\u0632 \u0648\u0631\u0648\u062f \u0645\u0648\u0641\u0642 \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631\u060c JSON Web Token \u0628\u0647 \u062f\u0633\u062a \u0622\u0645\u062f\u0647 \u0648 \u062f\u0631 \u062d\u0627\u0641\u0638\u0647 \u0645\u062d\u0644\u06cc (Local Storage) \u062f\u062e\u06cc\u0631\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0647\u0631 \u0628\u0627\u0631 \u06a9\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0642\u0635\u062f \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u06cc\u06a9 URL \u0645\u062d\u0627\u0641\u0638\u062a \u0634\u062f\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f\u060c \u062a\u0648\u06a9\u0646 \u062f\u0631 \u0647\u062f\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0633\u0631\u0648\u0631 \u0628\u0631\u0631\u0633\u06cc\u200c\u0647\u0627\u06cc \u0644\u0627\u0632\u0645 \u0631\u0627 \u0628\u0631\u0627\u06cc \u062a\u0627\u06cc\u06cc\u062f JWT \u0645\u0639\u062a\u0628\u0631 \u0627\u0646\u062c\u0627\u0645 \u062f\u0627\u062f\u0647 \u0648 \u0627\u06af\u0631 \u062a\u0627\u06cc\u06cc\u062f \u0634\u0648\u062f\u060c \u0628\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0627\u062c\u0627\u0632\u0647 \u062f\u0633\u062a\u0631\u0633\u06cc \u062f\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0646\u0645\u0648\u0646\u0647\u200c\u0627\u06cc \u0627\u0632 \u0647\u062f\u0631 \u0645\u062d\u062a\u0648\u0627\u06cc \u0645\u0639\u0645\u0648\u0644:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>Authorization: Bearer eyJhbGciOiJIUzI1NiIsI<\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0646\u0645\u0648\u062f\u0627\u0631 \u0632\u06cc\u0631 \u0641\u0631\u0627\u06cc\u0646\u062f \u0630\u06a9\u0631 \u0634\u062f\u0647 \u0648 \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u06cc\u0646 \u0645\u0631\u0648\u0631 \u06af\u0631 \u0648 \u0633\u0631\u0648\u0631 \u0628\u0647 \u062e\u0648\u0628\u06cc \u0646\u0634\u0627\u0646 \u062f\u0627\u062f\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a. \u0628\u0631\u0627\u06cc \u062f\u0631\u06a9 \u062e\u0648\u062f <strong>JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/strong> \u0645\u0637\u0627\u0644\u0628 \u0628\u062e\u0634\u200c\u0647\u0627\u06cc \u0628\u0639\u062f\u06cc \u0645\u0641\u06cc\u062f \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"1093\" height=\"642\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/7.jpg\" alt=\"\u0646\u062d\u0648\u0647 \u06a9\u0627\u0631\" class=\"wp-image-23373 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/7.jpg 1093w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/7-300x176.jpg 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/7-1024x601.jpg.webp 1024w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/7-768x451.jpg 768w\" data-sizes=\"(max-width: 1093px) 100vw, 1093px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1093px; --smush-placeholder-aspect-ratio: 1093\/642;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u0627\u0648\u0644 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0646\u0635\u0628 JWT \u062f\u0631 \u067e\u0631\u0648\u0698\u0647 \u0627\u0633\u062a. \u0627\u0632 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0628\u0631\u0627\u06cc \u0646\u0635\u0628 <strong>JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/strong> \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>pip install djangorestframework-simplejwt<\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0639\u062f \u0627\u0632 \u067e\u0627\u06cc\u0627\u0646 \u0646\u0635\u0628\u060c \u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u0641\u0627\u06cc\u0644 settings.py \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>REST_FRAMEWORK = {<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>    'DEFAULT_AUTHENTICATION_CLASSES': (<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>        ...<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>        'rest_framework_simplejwt.authentication.JWTAuthentication',<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>    )<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>{<\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0647\u0645\u0686\u0646\u06cc\u0646 \u0628\u0631\u0627\u06cc urls.py:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>from django.urls import path<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>from rest_framework_simplejwt import views <strong>as<\/strong> jwt_views<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>urlpatterns <strong>=<\/strong> [<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>    <em># Your URLs...<\/em><\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>    path('api\/token\/', jwt_views<strong>.<\/strong>TokenObtainPairView<strong>.<\/strong>as_view(), name<strong>=<\/strong>'token_obtain_pair'),<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>    path('api\/token\/refresh\/', jwt_views<strong>.<\/strong>TokenRefreshView<strong>.<\/strong>as_view(), name<strong>=<\/strong>'token_refresh'),<\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>]<\/code><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0686\u0646\u062f \u0646\u0645\u0648\u0646\u0647 \u06a9\u062f<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u0627\u0632 \u0645\u0633\u06cc\u0631 \u0632\u06cc\u0631 \u0648 \u0646\u0645\u0627\u06cc API \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><strong>views.py<\/strong><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code><span class=\"kn\">from<\/span> <span class=\"nn\">rest_framework.views<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">APIView<\/span> <\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code><span class=\"kn\">from<\/span> <span class=\"nn\">rest_framework.response<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">Response<\/span><\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code> <span class=\"kn\">from<\/span> <span class=\"nn\">rest_framework.permissions<\/span>  <span class=\"kn\">import<\/span> <span class=\"n\">IsAuthenticated<\/span> <\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code><span class=\"k\">class<\/span> <span class=\"nc\">HelloView<\/span><span class=\"p\">(<\/span><span class=\"n\">APIView<\/span><span class=\"p\">):<\/span> <\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code><span class=\"n\">permission_classes<\/span> <span class=\"o\">=<\/span> <span class=\"p\">(<\/span><span class=\"n\">IsAuthenticated<\/span><span class=\"p\">,)<\/span><\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code> <span class=\"k\">def<\/span> <span class=\"nf\">get<\/span><span class=\"p\">(<\/span><span class=\"bp\">self<\/span><span class=\"p\">,<\/span> <span class=\"n\">request<\/span><span class=\"p\">):<\/span><\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code> <span class=\"n\">content<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span><span class=\"s\">'message'<\/span><span class=\"p\">:<\/span> <span class=\"s\">'Hello, World!'<\/span><span class=\"p\">}<\/span> <\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code><span class=\"k\">return<\/span> <span class=\"n\">Response<\/span><span class=\"p\">(<\/span><span class=\"n\">content<\/span><span class=\"p\">)<\/span><\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-right\"><span style=\"font-size: 16px;\">\u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <strong>JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/strong> \u062f\u0627\u0631\u06cc\u0645:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><strong>urls.py<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code><span class=\"kn\">from<\/span> <span class=\"nn\">django.urls<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">path<\/span><\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code> <span class=\"kn\">from<\/span> <span class=\"nn\">myapi.core<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">views<\/span><\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code><span class=\"n\">urlpatterns<\/span> <span class=\"o\">=<\/span> <span class=\"p\">[<\/span> <\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code><span class=\"n\">path<\/span><span class=\"p\">(<\/span><span class=\"s\">'hello\/'<\/span><span class=\"p\">,<\/span> <span class=\"n\">views<\/span><span class=\"o\">.<\/span><span class=\"n\">HelloView<\/span><span class=\"o\">.<\/span><span class=\"n\">as_view<\/span><span class=\"p\">(),<\/span> <span class=\"n\">name<\/span><span class=\"o\">=<\/span><span class=\"s\">'hello'<\/span><span class=\"p\">),<\/span> <\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code><span class=\"p\">]<\/span><\/code><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u0628\u0631\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <strong>JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/strong>\u060c \u0627\u0632 \u0627\u0632 <a href=\"https:\/\/httpie.io\/\" rel=\"nofollow noopener\" target=\"_blank\">HTTPie <\/a> \u0628\u0631\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0646\u0642\u0627\u0637 \u067e\u0627\u06cc\u0627\u0646\u06cc (endpoints) API \u0627\u0632 \u0637\u0631\u06cc\u0642 \u062a\u0631\u0645\u06cc\u0646\u0627\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u062e\u0648\u0627\u0647\u062f \u0634\u062f. \u0627\u0645\u0627 \u0634\u0645\u0627 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 cURL (\u06a9\u0647 \u0628\u0647 \u0631\u0627\u062d\u062a\u06cc \u062f\u0631 \u0628\u0633\u06cc\u0627\u0631\u06cc \u0627\u0632 \u0633\u06cc\u0633\u062a\u0645 \u0639\u0627\u0645\u0644\u200c\u0647\u0627 \u0645\u0648\u062c\u0648\u062f \u0627\u0633\u062a) \u0628\u0631\u0627\u06cc \u062a\u0633\u062a \u0648 \u0622\u0632\u0645\u0648\u0646 \u0645\u0648\u0636\u0648\u0639\u0627\u062a \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u06cc\u0627 \u0628\u0647 \u0637\u0648\u0631 \u0645\u062a\u0646\u0627\u0648\u0628\u060c \u0628\u0627 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 URL \u0647\u0627\u06cc \u0646\u0642\u0637\u0647 \u067e\u0627\u06cc\u0627\u0646\u06cc \u0645\u0627\u0646\u0646\u062f \u062a\u0635\u0648\u06cc\u0631 \u0632\u06cc\u0631 \u0627\u0632 \u0648\u0627\u0633\u0637 \u0648\u0628 DRF \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\"><figure><img decoding=\"async\" class=\"aligncenter size-full wp-image-23367 lazyload\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/1-4.png\" alt=\"JWT \u062f\u0631 \u062c\u0646\u06af\u0648\" width=\"944\" height=\"708\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/1-4.png 944w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/1-4-300x225.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/1-4-768x576.png.webp 768w\" data-sizes=\"(max-width: 944px) 100vw, 944px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 944px; --smush-placeholder-aspect-ratio: 944\/708;\" \/><\/figure>\u062a\u0648\u06a9\u0646 \u0631\u0627 \u0628\u0647 \u062f\u0633\u062a \u0628\u06cc\u0627\u0648\u0631!<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u0648\u0644\u06cc\u0646 \u0642\u062f\u0645 \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u0648 \u0628\u0647 \u062f\u0633\u062a \u0622\u0648\u0631\u062f\u0646 \u062a\u0648\u06a9\u0646 \u0627\u0633\u062a. \u0628\u062f\u06cc\u0646 \u0645\u0646\u0638\u0648\u0631 \u0646\u0642\u0637\u0647 \u067e\u0627\u06cc\u0627\u0646\u06cc \u06cc\u0627 \u0647\u0645\u0627\u0646 End Point<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><em><strong>\/api\/token\/<\/strong><\/em><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0648\u062f\u0647 \u0648 \u0641\u0642\u0637 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627\u06cc POST \u0631\u0627 \u0642\u0628\u0648\u0644 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>http post http:\/\/127.0.0.1:8000\/api\/token\/ <span class=\"nv\">username<\/span><span class=\"o\">=<\/span>vitor <span class=\"nv\">password<\/span><span class=\"o\">=<\/span>\u06f1\u06f2\u06f3<\/code><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"800\" height=\"379\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/2-1.png\" alt=\"token\" class=\"wp-image-23368 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/2-1.png 800w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/2-1-300x142.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/2-1-768x364.png.webp 768w\" data-sizes=\"(max-width: 800px) 100vw, 800px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 800px; --smush-placeholder-aspect-ratio: 800\/379;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646\u060c \u0628\u0647 \u0637\u0648\u0631 \u06a9\u0644\u06cc \u062f\u0631 \u0628\u062f\u0646\u0647 \u067e\u06cc\u0627\u0645 \u067e\u0627\u0633\u062e\u060c \u062f\u0648 \u062a\u0648\u06a9\u0646 \u0627\u0633\u062a:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>{<\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code><span class=\"nt\">\"access\"<\/span><span class=\"p\">:<\/span> <span class=\"s2\">\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTQ1MjI0MjU5LCJqdGkiOiIyYmQ1NjI3MmIzYjI0YjNmOGI1MjJlNThjMzdjMTdlMSIsInVzZXJfaWQiOjF9.D92tTuVi_YcNkJtiLGHtcn6tBcxLCBxz9FKD3qzhUg8\"<\/span><span class=\"p\">,<\/span><\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code><span class=\"nt\">\"refresh\"<\/span><span class=\"p\">:<\/span> <span class=\"s2\">\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTU0NTMxMDM1OSwianRpIjoiMjk2ZDc1ZDA3Nzc2NDE0ZjkxYjhiOTY4MzI4NGRmOTUiLCJ1c2VyX2lkIjoxfQ.rA-mnGRg71NEW_ga0sJoaMODS5ABjE5HnxJDb0F8xAo\"<\/span> <\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code><span class=\"p\">}<\/span><\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-right\"><span style=\"font-size: 16px;\">\u067e\u0633 \u0627\u0632 \u0622\u0646 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0630\u062e\u06cc\u0631\u0647 access token \u0648 refresh token \u062f\u0631 \u0633\u0645\u062a \u06a9\u0644\u0627\u06cc\u0646\u062a ( \u0633\u0631\u0648\u06cc\u0633 \u06af\u06cc\u0631\u0646\u062f\u0647 \u062f\u0631 \u0634\u0628\u06a9\u0647) \u0627\u0633\u062a. \u0628\u0631\u0627\u06cc \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u0646\u0645\u0627\u0647\u0627\u06cc \u0645\u062d\u0627\u0641\u0638\u062a \u0634\u062f\u0647 \u062f\u0631 \u0628\u06a9\u200c\u0627\u0646\u062f (\u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062b\u0627\u0644\u060c \u0646\u0642\u0627\u0637 \u067e\u0627\u06cc\u0627\u0646\u06cc API \u06a9\u0647 \u0627\u062d\u062a\u06cc\u0627\u062c \u0628\u0647 \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u062f\u0627\u0631\u0646\u062f)\u060c \u0628\u0627\u06cc\u062f access token \u0631\u0627 \u062f\u0631 \u0647\u062f\u0631 \u0647\u0645\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f\u060c \u0645\u0627\u0646\u0646\u062f \u0627\u06cc\u0646:<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><code>http http:\/\/127.0.0.1:8000\/hello\/ <span class=\"s2\">\"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTQ1MjI0MjAwLCJqdGkiOiJlMGQxZDY2MjE5ODc0ZTY3OWY0NjM0ZWU2NTQ2YTIwMCIsInVzZXJfaWQiOjF9.9eHat3CvRQYnb5EdcgYFzUyMobXzxlAVh_IAgqyvzCE\"<\/span><\/code><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"800\" height=\"379\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/3-1.png\" alt=\"\u062a\u0648\u06a9\u0646 \u062f\u0631 JWT\" class=\"wp-image-23369 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/3-1.png 800w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/3-1-300x142.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/3-1-768x364.png.webp 768w\" data-sizes=\"(max-width: 800px) 100vw, 800px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 800px; --smush-placeholder-aspect-ratio: 800\/379;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-align-right\"><span style=\"font-size: 16px;\">\u0627\u06cc\u0646 token \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0631\u0627\u06cc \u06f5 \u062f\u0642\u06cc\u0642\u0647 \u0628\u0639\u062f\u06cc \u0645\u0639\u062a\u0628\u0631 \u0628\u0648\u062f\u0647 \u0648 \u067e\u0633 \u0627\u0632 \u06af\u062f\u0634\u062a \u06f5 \u062f\u0642\u06cc\u0642\u0647 \u062a\u0627\u0631\u06cc\u062e \u0627\u0646\u0642\u0636\u0627\u06cc\u0634 \u0628\u0647 \u067e\u0627\u06cc\u0627\u0646 \u0645\u06cc\u200c\u0631\u0633\u062f. \u0645\u06cc\u200c\u062f\u0627\u0646\u06cc\u0645 \u06a9\u0647 \u062a\u0648\u06a9\u0646 \u0628\u0647 \u062c\u0647\u062a \u062a\u0627\u06cc\u06cc\u062f \u0627\u0639\u062a\u0628\u0627\u0631 \u062d\u0636\u0648\u0631 \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u0627\u0633\u062a. \u062f\u0631 \u06cc\u06a9 \u0645\u062b\u0627\u0644 \u0633\u0627\u062f\u0647\u200c\u062a\u0631\u060c \u0641\u0631\u0636 \u06a9\u0646\u06cc\u062f \u0634\u0645\u0627 \u0648\u0627\u0631\u062f \u06cc\u06a9 \u0647\u0645\u0627\u06cc\u0634 \u0634\u062f\u0647\u200c\u0627\u06cc\u062f. \u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u0627\u0648\u0644 \u0648 \u062f\u0631 \u0647\u0646\u06af\u0627\u0645 \u0648\u0631\u0648\u062f \u0628\u0647 \u0633\u0627\u0644\u0646 \u0647\u0645\u0627\u06cc\u0634\u060c \u0646\u0627\u0645 \u0648 \u0646\u0627\u0645 \u06a9\u0627\u0631\u0628\u0631\u06cc \u062e\u0648\u062f \u0631\u0627 \u0628\u0647 \u0645\u0633\u0626\u0648\u0644 \u0645\u0631\u0628\u0648\u0637\u0647 \u0646\u0634\u0627\u0646 \u062f\u0627\u062f\u0647 \u0648 \u067e\u0633 \u0627\u0632 \u062a\u0627\u06cc\u06cc\u062f \u0647\u0648\u06cc\u062a \u0634\u0645\u0627\u060c \u0645\u0633\u0626\u0648\u0644 \u06cc\u06a9 \u062f\u0633\u062a\u0628\u0646\u062f \u0628\u0647 \u0645\u0646\u0632\u0644\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0645\u0639\u062a\u0628\u0631 \u0628\u0647 \u0634\u0645\u0627 \u0645\u06cc\u200c\u0632\u0646\u062f. \u062f\u0631 \u062f\u0641\u0639\u0627\u062a \u0628\u0639\u062f\u06cc \u062f\u0631 \u0635\u0648\u0631\u062a \u0648\u0631\u0648\u062f \u0648 \u062e\u0631\u0648\u062c \u0628\u0647 \u0633\u0627\u0644\u0646\u060c \u0645\u0633\u0626\u0648\u0644 \u062f\u06cc\u06af\u0631 \u0627\u0639\u062a\u0628\u0627\u0631 \u0647\u0648\u06cc\u062a \u0634\u0645\u0627 \u0631\u0627 \u0686\u06a9 \u0646\u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0641\u0642\u0637 \u0628\u0627 \u062f\u0627\u0634\u062a\u0646 \u062f\u0633\u0628\u062a\u0646\u062f \u0628\u0647 \u0634\u0645\u0627 \u0627\u062c\u0627\u0632\u0647 \u0648\u0631\u0648\u062f \u0648 \u062e\u0631\u0648\u062c \u0645\u06cc\u200c\u062f\u0647\u062f. \u0627\u0645\u0627 \u0628\u0631\u0627\u06cc \u062d\u0641\u0638 \u0627\u0645\u0646\u06cc\u062a \u0628\u06cc\u0634\u062a\u0631 \u062f\u0631 \u0633\u0637\u062d \u0634\u0628\u06a9\u0647 \u0648 \u0648\u0628\u060c \u062a\u0648\u06a9\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u067e\u0633 \u0627\u0632 \u0645\u062f\u062a\u06cc \u0645\u0646\u0642\u0636\u06cc \u0634\u062f\u0647 \u0648 \u0628\u0627 \u062e\u0637\u0627\u06cc \u0632\u06cc\u0631 \u0631\u0648\u0628\u0631\u0648 \u062e\u0648\u0627\u0647\u06cc\u062f \u0634\u062f:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>http http:\/\/127.0.0.1:8000\/hello\/ <span class=\"s2\">\"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTQ1MjI0MjAwLCJqdGkiOiJlMGQxZDY2MjE5ODc0ZTY3OWY0NjM0ZWU2NTQ2YTIwMCIsInVzZXJfaWQiOjF9.9eHat3CvRQYnb5EdcgYFzUyMobXzxlAVh_IAgqyvzCE\"<\/span><\/code><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"800\" height=\"505\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/jwt-expired-4.png\" alt=\"\" class=\"wp-image-23370 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/jwt-expired-4.png 800w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/jwt-expired-4-300x189.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/jwt-expired-4-768x485.png.webp 768w\" data-sizes=\"(max-width: 800px) 100vw, 800px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 800px; --smush-placeholder-aspect-ratio: 800\/505;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\"> (Refresh token) \u062f\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 JWT \u062f\u0631 django<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u062f\u0627\u0634\u062a\u0646 \u062a\u0648\u06a9\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u062c\u062f\u06cc\u062f\u060c \u0644\u0627\u0632\u0645 \u0627\u0633\u062a \u0627\u0632 refresh token endpoint\u060c \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0634\u0648\u062f:<\/span><\/p>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code>\/api\/token\/refresh\/<\/code><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u0627\u0631\u0633\u0627\u0644 refresh token \u062f\u0627\u0631\u06cc\u0645:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"800\" height=\"379\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/jwt-refresh-token5.png\" alt=\"\u0631\u0641\u0631\u0634 \u062a\u0648\u06a9\u0646\" class=\"wp-image-23371 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/06\/jwt-refresh-token5.png 800w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/jwt-refresh-token5-300x142.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/06\/jwt-refresh-token5-768x364.png.webp 768w\" data-sizes=\"(max-width: 800px) 100vw, 800px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 800px; --smush-placeholder-aspect-ratio: 800\/379;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-align-left\"><span style=\"font-size: 16px;\"><code><span class=\"n\">http<\/span> <span class=\"n\">post<\/span> <span class=\"n\">http<\/span><span class=\"p\">:<\/span><span class=\"o\">\/\/<\/span><span class=\"mf\">\u06f1\u06f2\u06f7.\u06f0<\/span><span class=\"o\">.<\/span><span class=\"mf\">\u06f0.\u06f1<\/span><span class=\"p\">:<\/span><span class=\"mi\">\u06f8\u06f0\u06f0\u06f0<\/span><span class=\"o\">\/<\/span><span class=\"n\">api<\/span><span class=\"o\">\/<\/span><span class=\"n\">token<\/span><span class=\"o\">\/<\/span><span class=\"n\">refresh<\/span><span class=\"o\">\/<\/span> <span class=\"n\">refresh<\/span><span class=\"o\">=<\/span><span class=\"n\">eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9<\/span><span class=\"o\">.<\/span><span class=\"n\">eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTU0NTMwODIyMiwianRpIjoiNzAyOGFlNjc0ZTdjNDZlMDlmMzUwYjg3MjU1NGUxODQiLCJ1c2VyX2lkIjoxfQ<\/span><span class=\"o\">.<\/span><span class=\"n\">Md8AO3dDrQBvWYWeZsd_A1J39z6b6HEwWIUZ7ilOiPE<\/span><\/code><\/span><\/p>\n\n\n\n<p class=\"has-text-align-right\"><span style=\"font-size: 16px;\">\u067e\u0627\u0633\u062e \u0628\u0631\u06af\u0634\u062a\u06cc \u06cc\u06a9 \u062a\u0648\u06a9\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u062c\u062f\u06cc\u062f \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0622\u0646 \u062f\u0631 \u0627\u0631\u062a\u0628\u0627\u0637\u0627\u062a \u0628\u0639\u062f\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f. \u062c\u0627\u0644\u0628 \u0627\u0633\u062a \u0628\u062f\u0627\u0646\u06cc\u062f \u062f\u0631 \u0627\u06cc\u0646 \u0641\u0631\u0627\u06cc\u0646\u062f\u060c \u0631\u0641\u0631\u0634 \u062a\u0648\u06a9\u0646 \u0628\u0631\u0627\u06cc \u06f2\u06f4 \u0633\u0627\u0639\u062a \u0628\u0639\u062f\u06cc \u0645\u0639\u062a\u0628\u0631 \u0628\u0648\u062f\u0647 \u0648 \u067e\u0633 \u0627\u0632 \u06af\u0630\u0634\u062a \u0627\u06cc\u0646 \u0632\u0645\u0627\u0646\u060c \u0628\u0627\u06cc\u062f \u0641\u0631\u0627\u06cc\u0646\u062f \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u0628\u0631\u0627\u06cc \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u062a\u0648\u06a9\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u0648 \u0631\u0641\u0631\u0634 \u062a\u0648\u06a9\u0646 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u0627\u0645 \u06a9\u0627\u0631\u0628\u0631\u06cc \u0648 \u06a9\u0644\u0645\u0647 \u0639\u0628\u0648\u0631 \u0627\u0646\u062c\u0627\u0645 \u0628\u06af\u06cc\u0631\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0646\u06af\u0627\u0647 \u0627\u0648\u0644 \u0634\u0627\u06cc\u062f refresh token \u0628\u06cc \u0645\u0639\u0646\u06cc \u0628\u0647 \u0646\u0638\u0631 \u0628\u0631\u0633\u062f\u060c \u0627\u0645\u0627 \u062f\u0631 \u0648\u0627\u0642\u0639 \u0644\u0627\u0632\u0645 \u0627\u0633\u062a \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u06a9\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0647\u0646\u0648\u0632 \u0645\u062c\u0648\u0632\u0647\u0627\u06cc \u0635\u062d\u06cc\u062d \u0631\u0627 \u062f\u0627\u0631\u062f. \u0627\u06af\u0631 \u062a\u0648\u06a9\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u0645\u062f\u062a \u0632\u0645\u0627\u0646 \u0627\u0646\u0642\u0636\u0627\u06cc \u0637\u0648\u0644\u0627\u0646\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f\u060c \u0627\u0645\u06a9\u0627\u0646 \u062f\u0627\u0631\u062f \u0628\u0647 \u0631\u0648\u0632 \u0631\u0633\u0627\u0646\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u062a\u0648\u06a9\u0646 \u0637\u0648\u0644 \u0628\u06a9\u0634\u062f. \u0632\u06cc\u0631\u0627 \u0686\u06a9 \u0648 \u0628\u0631\u0631\u0633\u06cc \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u0628\u0627 \u0631\u0645\u0632\u0646\u06af\u0627\u0631\u06cc \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f. \u0628\u0647 \u062c\u0627\u06cc \u0627\u06cc\u0646\u200c\u06a9\u0647 \u06cc\u06a9 \u0633\u0631\u06cc query \u0628\u0647 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0632\u062f\u0647 \u0634\u0648\u062f \u0648 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u062a\u0627\u06cc\u06cc\u062f \u06af\u0631\u062f\u0646\u062f. \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0628\u0631\u062e\u06cc \u0627\u0632 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u0647 \u0646\u0648\u0639\u06cc \u06a9\u0634( \u067e\u0646\u0647\u0627\u0646) \u0645\u06cc\u200c\u0634\u0648\u0646\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0627 \u06cc\u06a9 \u062c\u0646\u0628\u0647 \u062d\u0627\u0644\u062a\u06cc \u0647\u0645 \u0637\u0631\u0641\u06cc\u0645\u060c refresh token \u0641\u0642\u0637 \u0628\u0627 \u062f\u06cc\u062a\u0627\u06cc POST \u0648 access token \u0628\u0627 \u0647\u062f\u0631 HTTP \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc\u200c\u0634\u0648\u062f. \u06a9\u0647 \u0627\u0645\u06a9\u0627\u0646 \u062f\u0627\u0631\u062f \u062f\u0631 \u0637\u0648\u0644 \u0645\u0633\u06cc\u0631 \u0648\u0627\u0631\u062f \u0633\u06cc\u0633\u062a\u0645 \u0634\u0648\u062f.<\/span><\/p>\n\n\n<div class=\"jet-listing-grid--50192\" style=\"\"><style><\/style><section class=\"zht-related-post\" itemscope=\"\" itemtype=\"https:\/\/schema.org\/Article\" role=\"region\"\n  aria-label=\"Related article\">\n  <div class=\"zht-related-post-section-label\">\n    \u0645\u0637\u0627\u0644\u0628 \u0645\u0631\u062a\u0628\u0637\n  <\/div>\n  <img decoding=\"async\" width=\"300\" height=\"225\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/01\/learn-how-to-build-an-online-store-with-django-4-300x225.jpg.webp\" class=\"attachment-medium size-medium wp-post-image lazyload\" alt=\"\u0622\u0645\u0648\u0632\u0634 \u0633\u0627\u062e\u062a \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0627\u06cc\u0646\u062a\u0631\u0646\u062a\u06cc \u0628\u0627 \u062c\u0646\u06af\u0648\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/01\/learn-how-to-build-an-online-store-with-django-4-300x225.jpg.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/01\/learn-how-to-build-an-online-store-with-django-4-768x576.jpg.webp 768w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/01\/learn-how-to-build-an-online-store-with-django-4.jpg 1000w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" title=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/225;\">\n  <a href=\"https:\/\/maktabkhooneh.org\/mag\/learn-how-to-build-an-online-store-with-django\/\" class=\"zht-related-post-title\" itemprop=\"headline\" target=\"_blank\">\u0622\u0645\u0648\u0632\u0634 \u0633\u0627\u062e\u062a \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0627\u06cc\u0646\u062a\u0631\u0646\u062a\u06cc \u0628\u0627 \u062c\u0646\u06af\u0648<\/a>\n<\/section><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u062c\u0645\u0639 \u0628\u0646\u062f\u06cc \u0641\u0631\u06cc\u0645\u0648\u0631\u06a9 JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <strong>JWT \u062f\u0631 \u062c\u0646\u06af\u0648<\/strong> \u0628\u0631\u0627\u06cc \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u0631\u0648\u0634 \u0645\u0631\u0633\u0648\u0645\u06cc \u0627\u0633\u062a. \u0628\u0647 \u0637\u0648\u0631 \u06a9\u0644\u06cc \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062c\u0646\u06af\u0648\u060c \u06cc\u06a9 \u0686\u0627\u0631\u0686\u0648\u0628 \u062a\u0648\u0633\u0639\u0647 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u062f\u0631 \u0632\u0628\u0627\u0646 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0628\u0647 \u062d\u0633\u0627\u0628 \u0645\u06cc\u200c\u0622\u06cc\u062f. \u0627\u0632 \u062c\u0645\u0644\u0647 \u0645\u0647\u0645\u200c\u062a\u0631\u06cc\u0646 \u0627\u0635\u0648\u0644 \u067e\u0634\u062a \u067e\u0631\u062f\u0647 \u0637\u0631\u0627\u062d\u06cc \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062c\u0646\u06af\u0648 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0628\u0647 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u0646\u0633\u0628\u06cc \u0645\u0648\u0644\u0641\u0647\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0627\u06cc\u0646 \u0686\u0627\u0631\u0686\u0648\u0628\u060c \u06a9\u062f\u0646\u0648\u06cc\u0633\u06cc \u06a9\u0645\u062a\u0631\u060c \u0627\u0635\u0644 \u0639\u062f\u0645 \u062a\u06a9\u0631\u0627\u0631\u060c \u062a\u0648\u0633\u0639\u0647 \u0633\u0631\u06cc\u0639 \u0648 \u0637\u0631\u0627\u062d\u06cc \u062a\u0645\u06cc\u0632 \u0627\u0634\u0627\u0631\u0647 \u06a9\u0631\u062f. \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0627\u06af\u0631 \u062f\u0631 \u0627\u0628\u062a\u062f\u0627\u06cc \u0645\u0633\u06cc\u0631 \u0647\u0633\u062a\u06cc\u062f \u06cc\u0627 \u062d\u062a\u06cc \u062c\u0632 \u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\u200c\u0647\u0627\u06cc \u062e\u0648\u0628 \u0627\u06cc\u0646 \u0631\u0627\u0647 \u0647\u0633\u062a\u06cc\u062f\u060c \u06cc\u0627\u062f\u06af\u06cc\u0631\u06cc \u0641\u0631\u06cc\u0645\u0648\u0631\u06a9 \u062c\u0646\u06af\u0648 \u0628\u0647 \u0634\u0645\u0627 \u062f\u06cc\u062f \u0628\u0647\u062a\u0631 \u0648 \u0645\u0646\u0637\u0642\u06cc \u0645\u06cc\u200c\u062f\u0647\u062f.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0628\u0631\u0627\u06cc \u062f\u0627\u0634\u062a\u0646 \u0633\u06cc\u0633\u062a\u0645 Authentication \u062d\u06cc\u0646 \u0633\u0627\u062e\u062a API \u0627\u0632 \u0686\u0646\u062f \u0631\u0648\u0634 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u060c \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062b\u0627\u0644 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0628\u0647 \u0633\u06cc\u0633\u062a\u0645 \u062a\u0648\u06a9\u0646 \u062e\u0648\u062f Django Rest Framework \u06cc\u0627 \u0633\u06cc\u0633\u062a\u0645 JWT \u062f\u0631 \u062c\u0646\u06af\u0648 \u0627\u0634\u0627\u0631\u0647 \u06a9\u0631\u062f. JWT \u062f\u0631 \u0648\u0627\u0642\u0639 \u0645\u062e\u0641\u0641 \u06a9\u0644\u0645\u0627\u062a JSON Web Token \u0628\u0648\u062f\u0647 \u0648 \u06cc\u06a9 JSON \u0633\u0627\u062f\u0647 \u0627\u0633\u062a. \u0628\u0631\u0627\u06cc \u06a9\u0633\u0628 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u06cc\u0634\u062a\u0631 \u062f\u0631 \u0627\u06cc\u0646 \u0631\u0627\u0628\u0637\u0647 \u062a\u0627 \u067e\u0627\u06cc\u0627\u0646 \u0627\u06cc\u0646 [&hellip;]<\/p>\n","protected":false},"author":50,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-23366","post","type-post","status-publish","format-standard","hentry","category-programming-and-it-training"],"_links":{"self":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/23366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/comments?post=23366"}],"version-history":[{"count":2,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/23366\/revisions"}],"predecessor-version":[{"id":60569,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/23366\/revisions\/60569"}],"wp:attachment":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/media?parent=23366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/categories?post=23366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/tags?post=23366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}