MCPcopy
hub / github.com/authlib/authlib / _handle_token_hint

Method _handle_token_hint

authlib/oauth2/client.py:464–492  ·  view source on GitHub ↗
(
        self,
        hook,
        url,
        token=None,
        token_type_hint=None,
        body=None,
        auth=None,
        headers=None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

462 return self.token
463
464 def _handle_token_hint(
465 self,
466 hook,
467 url,
468 token=None,
469 token_type_hint=None,
470 body=None,
471 auth=None,
472 headers=None,
473 **kwargs,
474 ):
475 if token is None and self.token:
476 token = self.token.get("refresh_token") or self.token.get("access_token")
477
478 if body is None:
479 body = ""
480
481 body, headers = prepare_revoke_token_request(
482 token, token_type_hint, body, headers
483 )
484
485 for compliance_hook in self.compliance_hook[hook]:
486 url, headers, body = compliance_hook(url, headers, body)
487
488 if auth is None:
489 auth = self.client_auth(self.revocation_endpoint_auth_method)
490
491 session_kwargs = self._extract_session_request_params(kwargs)
492 return self._http_post(url, body, auth=auth, headers=headers, **session_kwargs)
493
494 def _prepare_token_endpoint_body(self, body, grant_type, **kwargs):
495 if grant_type == "authorization_code":

Callers 2

revoke_tokenMethod · 0.95
introspect_tokenMethod · 0.95

Calls 5

client_authMethod · 0.95
_http_postMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected