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

Commit d3bfbf0

Browse files
committed
Added dpop_enabled to endpoint_context.
1 parent 66ad918 commit d3bfbf0

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/oidcop/oauth2/add_on/dpop.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def add_support(endpoint, **kwargs):
146146
"dpop_signing_alg_values_supported"
147147
] = _algs_supported
148148

149-
# Other endpoint this may come in handy
149+
_endpoint_context = _token_endp.server_get("endpoint_context")
150+
_endpoint_context.dpop_enabled = True
150151

151152

152153
# DPoP-bound access token in the "Authorization" header and the DPoP proof in the "DPoP" header

src/oidcop/oidc/token.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ def process_request(self, req: Union[Message, dict], **kwargs):
4848
token_type = "Bearer"
4949

5050
# Is DPOP supported
51-
if "dpop_signing_alg_values_supported" in _context.provider_info:
51+
try:
52+
_dpop_enabled = _context.dpop_enabled
53+
except AttributeError:
54+
_dpop_enabled = False
55+
56+
if _dpop_enabled:
5257
_dpop_jkt = req.get("dpop_jkt")
5358
if _dpop_jkt:
5459
grant.extra["dpop_jkt"] = _dpop_jkt

0 commit comments

Comments
 (0)