Skip to content

Commit 9afd975

Browse files
committed
Add setting for session token ID verification
1 parent 56c721d commit 9afd975

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

rest_framework_sso/authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def authenticate_credentials(self, payload):
6363

6464
user_model = get_user_model()
6565

66-
if not SessionToken._meta.abstract:
66+
if api_settings.VERIFY_SESSION_TOKEN:
6767
try:
6868
SessionToken.objects.active().get(pk=payload.get('sid'), user_id=payload.get('uid'))
6969
except SessionToken.DoesNotExist:

rest_framework_sso/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'DECODE_ALGORITHMS': None,
2020
'VERIFY_SIGNATURE': True,
2121
'VERIFY_EXPIRATION': True,
22+
'VERIFY_SESSION_TOKEN': True,
2223
'EXPIRATION_LEEWAY': 0,
2324
'SESSION_EXPIRATION': None,
2425
'AUTHORIZATION_EXPIRATION': datetime.timedelta(seconds=300),

0 commit comments

Comments
 (0)