Skip to content

Commit 95c8912

Browse files
committed
fix: use token_checksum for lookup in _get_token_from_authentication_server
1 parent bade920 commit 95c8912

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

AUTHORS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Frederico Vieira
6161
Gaël Utard
6262
Glauco Junior
6363
Giovanni Giampauli
64+
Hamid Hashemi
6465
Hasan Ramezani
6566
Hiroki Kiyohara
6667
Hossein Shakiba
@@ -129,4 +130,4 @@ Yuri Savin
129130
Miriam Forner
130131
Alex Kerkum
131132
Tuhin Mitra
132-
q0w
133+
q0w

oauth2_provider/oauth2_validators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,11 @@ def _get_token_from_authentication_server(
445445
expires, timezone=get_timezone(oauth2_settings.AUTHENTICATION_SERVER_EXP_TIME_ZONE)
446446
)
447447

448+
token_checksum = hashlib.sha256(token.encode("utf-8")).hexdigest()
448449
access_token, _created = AccessToken.objects.update_or_create(
449-
token=token,
450+
token_checksum=token_checksum,
450451
defaults={
452+
"token": token,
451453
"user": user,
452454
"application": None,
453455
"scope": scope,

0 commit comments

Comments
 (0)