Skip to content

Introspection : response when the bearer is ok, but the token is not#698

@broxane

Description

@broxane

RFC 7662 specifies that :

If the introspection call is properly authorized but the token is not
active, does not exist on this server, or the protected resource is
not allowed to introspect this particular token, then the
authorization server MUST return an introspection response with the
"active" field set to "false".

However, in introspect.py:

@staticmethoddefget_token_response(token_value=None): try: token=get_access_token_model().objects.get(token=token_value) exceptObjectDoesNotExist: returnHttpResponse( content=json.dumps({"active": False}), status=401, content_type="application/json" ) else: iftoken.is_valid(): [ ... ] else: returnHttpResponse(content=json.dumps({"active": False, }), status=200, content_type="application/json")

Is there a reason not to send the same response when the token does not exists or is invalid ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions