Тёмный

Django Login using Access & Refresh Tokens 

Scalable Scripts
Подписаться 35 тыс.
Просмотров 15 тыс.
50% 1

👉 Check our website: scalablescript...
Learn how to Authenticate using Access & Refresh tokens using Python Django.
Source Code: github.com/sca...
Select one Frontend to complete this app:
React Login using Access & Refresh Tokens: • React Login using Acce...
VueJS Login using Access & Refresh Tokens: • VueJS Login using Acce...
Angular Login using Access & Refresh Tokens: • Angular Login using Ac...
Svelte Login using Access & Refresh Tokens: • Svelte Login using Acc...
Want to learn to login using two-factor authentication or using your google account?
Check out these courses:
The Ultimate Authentication Course with Django and React: scalablescript...
The Ultimate Authentication Course with Django and VueJS: scalablescript...
The Ultimate Authentication Course with Django and Angular: scalablescript...
The Ultimate Authentication Course with Django and Svelte: scalablescript...
Get access to all my Django courses for $8/month:
NodeJS Bundle: scalablescript...
Get access to all my courses: scalablescript...
#django #authentication #python

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@chnarsimha-y2h
@chnarsimha-y2h Год назад
Your just deleting the access token from cookies but i want to blacklist the refresh and access token at a time .
@ahmed-zeini
@ahmed-zeini 2 года назад
Thanks soo much for this video, its good to work with token stored on cookies or database ?
@powerfulmath8488
@powerfulmath8488 2 года назад
where does the access secret come from 14:47
@taherbenhmida1063
@taherbenhmida1063 2 года назад
API refresh not working it always returns unauthenticated, I had checked the refresh token in the cookies it is present
@yxoeb6199
@yxoeb6199 2 года назад
import jwt, datetime from rest_framework import exceptions def create_access_token(id): return jwt.encode({ 'user_id': id, 'exp': datetime.datetime.utcnow() + datetime.timedelta(seconds=30), 'iat': datetime.datetime.utcnow() }, 'access_secret', algorithm='HS256') def decode_access_token(token): try: payload = jwt.decode(token, 'access_secret', algorithms='HS256') return payload['user_id'] except: raise exceptions.AuthenticationFailed('unauthenticated') def create_refresh_token(id): return jwt.encode({ 'user_id': id, 'exp': datetime.datetime.utcnow() + datetime.timedelta(days=7), 'iat': datetime.datetime.utcnow() }, 'refresh_secret', algorithm='HS256') def decode_refresh_token(token): try: payload = jwt.decode(token, 'refresh_secret', algorithms='HS256') return payload['user_id'] except: raise exceptions.AuthenticationFailed('unauthenticated')
@andremyszko
@andremyszko Год назад
**do not forget to decode your jwtToken before send it to refres** You need to remove the b'' from byte strings... so: return jwt.encode({...}).decode(utf-8)
Далее
React Login using Access & Refresh Tokens
38:32
Просмотров 57 тыс.
Inside Out 2: BABY JOY VS SHIN SONIC 4
00:16
Просмотров 5 млн
Authentication & Refreshing Tokens Implementation
2:09:53
Angular Login using Access & Refresh Tokens
22:44
Просмотров 27 тыс.
Django API Authentication using JWT Tokens
37:06
Просмотров 183 тыс.
Django REST Framework - Build an API from Scratch
40:39
Django-Sesame - Scoped Tokens and Authenticated Links
17:59
Django REST Framework Oversimplified
9:43
Просмотров 328 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 82 тыс.