Skip to content

Commit 543cd8f

Browse files
committed
Added another client authn method this is based on a pushed authorization predating an authorization. Where the actual authentication is made at the pushed authorization endpoint.
1 parent f0a690a commit 543cd8f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/idpyoidc/server/client_authn.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,29 @@ def _verify(
427427
return {"client_id": client_id, "jwt": _jwt}
428428

429429

430+
class PushedAuthorization(ClientAuthnMethod):
431+
# The premise here is that there has been a client authentication at the
432+
# pushed authorization endpoint
433+
tag = "pushed_authz"
434+
435+
def is_usable(self, request=None, authorization_token=None):
436+
_request_uri = request.get("request_uri", None)
437+
if _request_uri:
438+
_context = self.upstream_get("context")
439+
if _request_uri.startswith("urn:uuid:") and _request_uri in _context.par_db:
440+
return True
441+
442+
def _verify(
443+
self,
444+
request: Optional[Union[dict, Message]] = None,
445+
authorization_token: Optional[str] = None,
446+
endpoint=None, # Optional[Endpoint]
447+
**kwargs,
448+
):
449+
client_id = request["client_id"]
450+
return {"client_id": client_id}
451+
452+
430453
CLIENT_AUTHN_METHOD = dict(
431454
client_secret_basic=ClientSecretBasic,
432455
client_secret_post=ClientSecretPost,
@@ -437,6 +460,7 @@ def _verify(
437460
request_param=RequestParam,
438461
public=PublicAuthn,
439462
none=NoneAuthn,
463+
pushed_authz=PushedAuthorization
440464
)
441465

442466
TYPE_METHOD = [(JWT_BEARER, JWSAuthnMethod)]

0 commit comments

Comments
 (0)