Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the jti claim optional as per RFC 7519 Section 4.1.7 #63

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions rest_framework_simplejwt/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ def verify(self):
# claim. We don't want any zombie tokens walking around.
self.check_exp()

# Ensure token id is present
if 'jti' not in self.payload:
raise TokenError(_('Token has no id'))

self.verify_token_type()

def verify_token_type(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def test_init_no_jti_token_given(self):
t = MyToken()
del t['jti']

with self.assertRaises(TokenError):
MyToken(str(t))
t2 = MyToken(str(t))
self.assertEqual(t.payload, t2.payload)

def test_str(self):
token = MyToken()
Expand Down