MCPcopy
hub / github.com/authlib/authlib / get_client_algorithm

Method get_client_algorithm

authlib/oidc/core/grants/_legacy.py:26–41  ·  view source on GitHub ↗

Return the algorithm for encoding ``id_token``. By default, it will use ``client.id_token_signed_response_alg``, if not defined, ``RS256`` will be used. But you can override this method to customize the returned algorithm.

(self, client)

Source from the content-addressed store, hash-verified

24 return config["key"]
25
26 def get_client_algorithm(self, client):
27 """Return the algorithm for encoding ``id_token``. By default, it will
28 use ``client.id_token_signed_response_alg``, if not defined, ``RS256``
29 will be used. But you can override this method to customize the returned
30 algorithm.
31 """
32 # Per OpenID Connect Registration 1.0 Section 2:
33 # Use client's id_token_signed_response_alg if specified
34 config = self._compatible_resolve_jwt_config(None, client)
35 alg = config.get("alg")
36 if alg:
37 return alg
38
39 if hasattr(client, "id_token_signed_response_alg"):
40 return client.id_token_signed_response_alg or "RS256"
41 return "RS256"
42
43 def get_client_claims(self, client):
44 """Return the default client claims for encoding the ``id_token``. Developers

Callers 3

get_encode_headerMethod · 0.95
encode_id_tokenMethod · 0.80

Calls 2

getMethod · 0.45

Tested by

no test coverage detected