Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 76c3fdc

Browse files
committed
Allow alg == "none"
1 parent befb1ed commit 76c3fdc

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/oidcrp/oidc/authorization.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ def construct_request_parameter(self, req, request_param, audience=None, expires
158158
if "keys" not in kwargs and alg and alg != "none":
159159
kwargs["keys"] = _context.keyjar
160160

161+
if alg == "none":
162+
kwargs["keys"] = []
163+
161164
_srv_cntx = _context
162165

163166
# This is the issuer of the JWT, that is me !

src/oidcrp/rp_handler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def do_client_registration(self, client=None,
277277
_context.set('callbacks', callbacks)
278278

279279
_params = RegistrationRequest().parameters()
280-
request_args = {k:v for k, v in behaviour_args.items() if k in _params}
280+
request_args = {k: v for k, v in behaviour_args.items() if k in _params}
281281
load_registration_response(client, request_args=request_args)
282282

283283
def add_callbacks(self, service_context):
@@ -618,10 +618,12 @@ def userinfo_in_id_token(id_token):
618618
res.update(id_token.extra())
619619
return res
620620

621-
def finalize_auth(self, client, issuer, response):
621+
def finalize_auth(self, client, issuer: str, response: dict,
622+
behaviour_args: Optional[dict] = None):
622623
"""
623624
Given the response returned to the redirect_uri, parse and verify it.
624625
626+
:param behaviour_args: For fine tuning behaviour
625627
:param client: A Client instance
626628
:param issuer: An Issuer ID
627629
:param response: The authorization response as a dictionary

0 commit comments

Comments
 (0)