Skip to content

Commit 4148bff

Browse files
committed
feat: reject dpop_key + use_mtls in signin_with_passkey
1 parent 01dbec3 commit 4148bff

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/auth0_server_python/auth_server/server_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3338,6 +3338,12 @@ async def signin_with_passkey(
33383338
raise MissingRequiredArgumentError("auth_session")
33393339
if authn_response is None:
33403340
raise MissingRequiredArgumentError("authn_response")
3341+
if self._use_mtls and dpop_key is not None:
3342+
raise ConfigurationError(
3343+
"dpop_key cannot be combined with use_mtls. DPoP and mTLS bind tokens "
3344+
"differently; DPoP would take precedence and the token would not be "
3345+
"certificate-bound."
3346+
)
33413347

33423348
try:
33433349
domain = await self._resolve_current_domain(store_options)

src/auth0_server_python/tests/test_server_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9805,6 +9805,17 @@ async def test_apply_client_auth_mtls_returns_none_and_strips_creds():
98059805
assert "client_assertion_type" not in params
98069806

98079807

9808+
@pytest.mark.asyncio
9809+
async def test_signin_with_passkey_rejects_dpop_under_mtls(mocker):
9810+
client = _mtls_client()
9811+
with pytest.raises(ConfigurationError):
9812+
await client.signin_with_passkey(
9813+
auth_session="sess",
9814+
authn_response=mocker.Mock(),
9815+
dpop_key=object(),
9816+
)
9817+
9818+
98089819
@pytest.mark.asyncio
98099820
async def test_complete_interactive_login_uses_mtls_token_endpoint(mocker):
98109821
mock_tx_store = AsyncMock()

0 commit comments

Comments
 (0)