summaryrefslogtreecommitdiff
path: root/docs/oauth2/endpoints/introspect.rst
blob: 53ade8b2c4284acbd5a24fe57d56b1ef39c7ae06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
===================
Token introspection
===================

Introspect endpoints read opaque access and/or refresh tokens upon client
request. Also known as tokeninfo.

.. code-block:: python

    # Initial setup
    from your_validator import your_validator
    server = WebApplicationServer(your_validator)

    # Token revocation
    uri = 'https://example.com/introspect'
    headers, body, http_method = {}, 'token=sldafh309sdf', 'POST'

    headers, body, status = server.create_introspect_response(uri,
        headers=headers, body=body, http_method=http_method)

    from your_framework import http_response
    http_response(body, status=status, headers=headers)


.. autoclass:: oauthlib.oauth2.IntrospectEndpoint
    :members: