Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update request object typ #293

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pyeudiw/satosa/default/request_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class RequestHandler(RequestHandlerInterface, BackendDPoP, BackendTrust):

_RESP_CONTENT_TYPE = "application/oauth-authz-req+jwt"
_REQUEST_OBJECT_TYP = "oauth-authz-req+jwt"

def request_endpoint(self, context: Context, *args) -> Response:
self._log_function_debug("response_endpoint", context, "args", args)
Expand Down Expand Up @@ -57,7 +58,10 @@ def request_endpoint(self, context: Context, *args) -> Response:
helper = JWSHelper(self.default_metadata_private_jwk)
request_object_jwt = helper.sign(
data,
protected={'trust_chain': self.get_backend_trust_chain()}
protected={
'trust_chain': self.get_backend_trust_chain(),
'typ': RequestHandler._REQUEST_OBJECT_TYP
}
)
return Response(
message=request_object_jwt,
Expand Down
1 change: 1 addition & 0 deletions pyeudiw/tests/satosa/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ def test_request_endpoint(self, context):
payload = decode_jwt_payload(request_object_jwt)
assert header["alg"]
assert header["kid"]
assert header["typ"] == "oauth-authz-req+jwt"
assert payload["scope"] == " ".join(CONFIG["authorization"]["scopes"])
assert payload["client_id"] == CONFIG["metadata"]["client_id"]
assert payload["response_uri"] == CONFIG["metadata"]["response_uris_supported"][0]
Expand Down
Loading