Skip to content

Commit 2467913

Browse files
ZuSen2ygk
authored andcommitted
Not existing tokens should return 200 as well
Compare with https://datatracker.ietf.org/doc/html/rfc7662
1 parent c42423c commit 2467913

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oauth2_provider/views/introspect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_token_response(token_value=None):
2828
get_access_token_model().objects.select_related("user", "application").get(token=token_value)
2929
)
3030
except ObjectDoesNotExist:
31-
return JsonResponse({"active": False}, status=401)
31+
return JsonResponse({"active": False}, status=200)
3232
else:
3333
if token.is_valid():
3434
data = {
@@ -42,7 +42,7 @@ def get_token_response(token_value=None):
4242
data["username"] = token.user.get_username()
4343
return JsonResponse(data)
4444
else:
45-
return JsonResponse({"active": False})
45+
return JsonResponse({"active": False}, status=200)
4646

4747
def get(self, request, *args, **kwargs):
4848
"""

0 commit comments

Comments
 (0)