MCPcopy
hub / github.com/authlib/authlib / refresh_token

Method refresh_token

authlib/oauth2/rfc7521/client.py:62–83  ·  view source on GitHub ↗

Using Assertions as Authorization Grants to refresh token as described in `Section 4.1`_. .. _`Section 4.1`: https://tools.ietf.org/html/rfc7521#section-4.1

(self)

Source from the content-addressed store, hash-verified

60 self.token_auth.set_token(token)
61
62 def refresh_token(self):
63 """Using Assertions as Authorization Grants to refresh token as
64 described in `Section 4.1`_.
65
66 .. _`Section 4.1`: https://tools.ietf.org/html/rfc7521#section-4.1
67 """
68 generate_assertion = self.ASSERTION_METHODS[self.grant_type]
69 assertion = generate_assertion(
70 issuer=self.issuer,
71 subject=self.subject,
72 audience=self.audience,
73 claims=self.claims,
74 **self._kwargs,
75 )
76 data = {
77 "assertion": to_native(assertion),
78 "grant_type": self.grant_type,
79 }
80 if self.scope:
81 data["scope"] = self.scope
82
83 return self._refresh_token(data)
84
85 def parse_response_token(self, resp):
86 if resp.status_code >= 500:

Callers 1

requestMethod · 0.95

Calls 2

_refresh_tokenMethod · 0.95
to_nativeFunction · 0.90

Tested by

no test coverage detected