summaryrefslogtreecommitdiff
path: root/oauthlib/openid/connect/core/endpoints/userinfo.py
diff options
context:
space:
mode:
Diffstat (limited to 'oauthlib/openid/connect/core/endpoints/userinfo.py')
-rw-r--r--oauthlib/openid/connect/core/endpoints/userinfo.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/oauthlib/openid/connect/core/endpoints/userinfo.py b/oauthlib/openid/connect/core/endpoints/userinfo.py
index 1c29cc5..7aa2bbe 100644
--- a/oauthlib/openid/connect/core/endpoints/userinfo.py
+++ b/oauthlib/openid/connect/core/endpoints/userinfo.py
@@ -69,7 +69,7 @@ class UserInfoEndpoint(BaseEndpoint):
5.3.1. UserInfo Request
The Client sends the UserInfo Request using either HTTP GET or HTTP
POST. The Access Token obtained from an OpenID Connect Authentication
- Request MUST be sent as a Bearer Token, per Section 2 of OAuth 2.0
+ Request MUST be sent as a Bearer Token, per `Section 2`_ of OAuth 2.0
Bearer Token Usage [RFC6750].
It is RECOMMENDED that the request use the HTTP GET method and the
@@ -77,21 +77,28 @@ class UserInfoEndpoint(BaseEndpoint):
The following is a non-normative example of a UserInfo Request:
- GET /userinfo HTTP/1.1
- Host: server.example.com
- Authorization: Bearer SlAV32hkKG
+ .. code-block:: http
+
+ GET /userinfo HTTP/1.1
+ Host: server.example.com
+ Authorization: Bearer SlAV32hkKG
5.3.3. UserInfo Error Response
When an error condition occurs, the UserInfo Endpoint returns an Error
- Response as defined in Section 3 of OAuth 2.0 Bearer Token Usage
+ Response as defined in `Section 3`_ of OAuth 2.0 Bearer Token Usage
[RFC6750]. (HTTP errors unrelated to RFC 6750 are returned to the User
Agent using the appropriate HTTP status code.)
The following is a non-normative example of a UserInfo Error Response:
- HTTP/1.1 401 Unauthorized
- WWW-Authenticate: Bearer error="invalid_token",
+ .. code-block:: http
+
+ HTTP/1.1 401 Unauthorized
+ WWW-Authenticate: Bearer error="invalid_token",
error_description="The Access Token expired"
+
+ .. _`Section 2`: https://datatracker.ietf.org/doc/html/rfc6750#section-2
+ .. _`Section 3`: https://datatracker.ietf.org/doc/html/rfc6750#section-3
"""
if not self.bearer.validate_request(request):
raise errors.InvalidTokenError()