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

Method query_token

authlib/oauth2/rfc7009/revocation.py:76–88  ·  view source on GitHub ↗

Get the token from database/storage by the given token string. Developers should implement this method:: def query_token(self, token_string, token_type_hint): if token_type_hint == 'access_token': return Token.query_by_access_token(token_strin

(self, token_string, token_type_hint)

Source from the content-addressed store, hash-verified

74 return 200, {}, default_json_headers
75
76 def query_token(self, token_string, token_type_hint):
77 """Get the token from database/storage by the given token string.
78 Developers should implement this method::
79
80 def query_token(self, token_string, token_type_hint):
81 if token_type_hint == 'access_token':
82 return Token.query_by_access_token(token_string)
83 if token_type_hint == 'refresh_token':
84 return Token.query_by_refresh_token(token_string)
85 return Token.query_by_access_token(token_string) or \
86 Token.query_by_refresh_token(token_string)
87 """
88 raise NotImplementedError()
89
90 def revoke_token(self, token, request):
91 """Mark token as revoked. Since token MUST be unique, it would be

Callers 1

authenticate_tokenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected