How to use the webauthn.webauthn function in webauthn

To help you get started, we’ve selected a few webauthn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pypa / warehouse / tests / unit / utils / test_webauthn.py View on Github external
def test_verify_registration_response_failure(monkeypatch):
    response_obj = pretend.stub(
        verify=pretend.raiser(pywebauthn.webauthn.RegistrationRejectedException)
    )
    response_cls = pretend.call_recorder(lambda *a, **kw: response_obj)
    monkeypatch.setattr(pywebauthn, "WebAuthnRegistrationResponse", response_cls)

    with pytest.raises(webauthn.RegistrationRejectedException):
        webauthn.verify_registration_response(
            {}, "not_a_real_challenge", rp_id="fake_rp_id", origin="fake_origin"
        )