MCPcopy
hub / github.com/authlib/authlib / process_token

Method process_token

authlib/oidc/core/grants/code.py:87–97  ·  view source on GitHub ↗
(self, grant, response)

Source from the content-addressed store, hash-verified

85 return jwt.encode(header, claims, private_key, [alg])
86
87 def process_token(self, grant, response):
88 _, token, _ = response
89 scope = token.get("scope")
90 if not scope or not is_openid_scope(scope):
91 # standard authorization code flow
92 return token
93
94 request: OAuth2Request = grant.request
95 id_token = self.encode_id_token(token, request)
96 token["id_token"] = id_token
97 return token
98
99 def __call__(self, grant):
100 grant.register_hook("after_create_token_response", self.process_token)

Callers

nothing calls this directly

Calls 3

encode_id_tokenMethod · 0.95
is_openid_scopeFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected