http post http://127.0.0.1:8000/api/token/ username=akash password=Akashsky13
{
"access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjA2MTg1MzkwLCJqdGkiOiI3MTcxOTZlN2E3Yjk0M2I0YWRjNmU0YWZhYjEzZWQ2MSIsInVzZXJfaWQiOjF9.aQQHPGsSHpIf38Bhww76WNOwsZ4PiChgn1a1OV_IlD4",
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYwNjI3MTQ5MCwianRpIjoiN2I5OTMxN2Q2ZWViNDI3YzhiNGUxM2FkMTQzNzRhNmEiLCJ1c2VyX2lkIjoxfQ.aayavlSfDbVoDltJOqMWO-ru6T1307iLhLRODx2zACU"
}
http http://localhost:8000/api/v1/post/ "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjA2MTg1MzkwLCJqdGkiOiI3MTcxOTZlN2E3Yjk0M2I0YWRjNmU0YWZhYjEzZWQ2MSIsInVzZXJfaWQiOjF9.aQQHPGsSHpIf38Bhww76WNOwsZ4PiChgn1a1OV_IlD4"
When the access
token is expired after 5 minutes (or as per ACCESS_TOKEN_LIFETIME
value) submit refresh token
http post http://127.0.0.1:8000/api/token/refresh/ refresh=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYwNjI3MTQ5MCwianRpIjoiN2I5OTMxN2Q2ZWViNDI3YzhiNGUxM2FkMTQzNzRhNmEiLCJ1c2VyX2lkIjoxfQ.aayavlSfDbVoDltJOqMWO-ru6T1307iLhLRODx2zACU
{
"access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjA2MTg2MjAyLCJqdGkiOiJkYTBmMDQ1YjgzNGU0MmRkYmI0NDVhODdlMThmMjA3OSIsInVzZXJfaWQiOjF9.CqElqbkiLmLh7eItHAmKnHlTeaxTy3y4aVMsJ5nAaOM"
}
http http://localhost:8000/api/v1/post/ "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjA2MTg2MjAyLCJqdGkiOiJkYTBmMDQ1YjgzNGU0MmRkYmI0NDVhODdlMThmMjA3OSIsInVzZXJfaWQiOjF9.CqElqbkiLmLh7eItHAmKnHlTeaxTy3y4aVMsJ5nAaOM"
Your ACCESS_TOKEN_LIFETIME
should be typically set to 5 minutes but it's customizable.
Your REFRESH_TOKEN_LIFETIME
should be typically set to 24 hours but it's customizable.