MCPcopy Create free account
hub / github.com/authlib/authlib / authenticate_token

Method authenticate_token

authlib/oauth2/rfc7009/revocation.py:17–35  ·  view source on GitHub ↗

The client constructs the request by including the following parameters using the "application/x-www-form-urlencoded" format in the HTTP request entity-body: token REQUIRED. The token that the client wants to get revoked. token_type_hint OPT

(self, request, client)

Source from the content-addressed store, hash-verified

15 ENDPOINT_NAME = "revocation"
16
17 def authenticate_token(self, request, client):
18 """The client constructs the request by including the following
19 parameters using the "application/x-www-form-urlencoded" format in
20 the HTTP request entity-body:
21
22 token
23 REQUIRED. The token that the client wants to get revoked.
24
25 token_type_hint
26 OPTIONAL. A hint about the type of the token submitted for
27 revocation.
28 """
29 self.check_params(request, client)
30 token = self.query_token(
31 request.form["token"], request.form.get("token_type_hint")
32 )
33 if token and not token.check_client(client):
34 raise InvalidGrantError()
35 return token
36
37 def check_params(self, request, client):
38 if "token" not in request.form:

Callers 1

Calls 5

check_paramsMethod · 0.95
query_tokenMethod · 0.95
InvalidGrantErrorClass · 0.85
getMethod · 0.45
check_clientMethod · 0.45

Tested by

no test coverage detected