summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJonathan Huot <jonathan.huot@thomsonreuters.com>2017-11-08 09:55:03 +0100
committerJonathan Huot <jonathan.huot@thomsonreuters.com>2017-12-18 10:21:52 +0100
commit9b95e4e8f094d78abe577203ad1ef53aecfdb270 (patch)
tree6cc1a464b59e08e1970ec3641072907d496baa18 /docs
parentcfb82feb03fcd60b3b66ac09bf1b478cd5f11b7d (diff)
downloadoauthlib-9b95e4e8f094d78abe577203ad1ef53aecfdb270.tar.gz
Added initial introspect support
Diffstat (limited to 'docs')
-rw-r--r--docs/feature_matrix.rst1
-rw-r--r--docs/oauth2/endpoints/endpoints.rst6
-rw-r--r--docs/oauth2/endpoints/introspect.rst26
3 files changed, 32 insertions, 1 deletions
diff --git a/docs/feature_matrix.rst b/docs/feature_matrix.rst
index 0f9021d..59f3f3a 100644
--- a/docs/feature_matrix.rst
+++ b/docs/feature_matrix.rst
@@ -17,6 +17,7 @@ OAuth 2 client and provider support for
- Bearer Tokens
- Draft MAC tokens
- Token Revocation
+- Token Introspection
- OpenID Connect Authentication
with support for SAML2 and JWT tokens, dynamic client registration and more to
diff --git a/docs/oauth2/endpoints/endpoints.rst b/docs/oauth2/endpoints/endpoints.rst
index 0e70798..5f7ae8c 100644
--- a/docs/oauth2/endpoints/endpoints.rst
+++ b/docs/oauth2/endpoints/endpoints.rst
@@ -14,11 +14,12 @@ client attempts to access the user resources on their behalf.
:maxdepth: 2
authorization
+ introspect
token
resource
revocation
-There are three different endpoints, the authorization endpoint which mainly
+There are three main endpoints, the authorization endpoint which mainly
handles user authorization, the token endpoint which provides tokens and the
resource endpoint which provides access to protected resources. It is to the
endpoints you will feed requests and get back an almost complete response. This
@@ -27,3 +28,6 @@ later.
The main purpose of the endpoint in OAuthLib is to figure out which grant type
or token to dispatch the request to.
+
+Then, you can extend your OAuth implementation by proposing introspect or
+revocation endpoints.
diff --git a/docs/oauth2/endpoints/introspect.rst b/docs/oauth2/endpoints/introspect.rst
new file mode 100644
index 0000000..53ade8b
--- /dev/null
+++ b/docs/oauth2/endpoints/introspect.rst
@@ -0,0 +1,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: