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

Method process_token

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

Source from the content-addressed store, hash-verified

87 return jwt.encode(header, claims, private_key, [alg])
88
89 def process_token(self, grant, response):
90 _, token, _ = response
91 scope = token.get("scope")
92 if not scope or not is_openid_scope(scope):
93 # standard authorization code flow
94 return token
95
96 request: OAuth2Request = grant.request
97 id_token = self.encode_id_token(token, request)
98 token["id_token"] = id_token
99 return token
100
101 def __call__(self, grant):
102 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