Skip to content

Commit 0c5ef36

Browse files
fix: Correct webauthn JSON parsing to be compliant with standard. (#1658)
'rpid' -> 'rpId': https://www.w3.org/TR/webauthn-3/#dom-publickeycredentialrequestoptionsjson-rpid Co-authored-by: Harkamal Jot Singh Kumar <harkamaljot@users.noreply.github.com>
1 parent ee1c7d3 commit 0c5ef36

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

google/oauth2/webauthn_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class GetRequest:
6767
extensions: Optional[AuthenticationExtensionsClientInputs] = None
6868

6969
def to_json(self) -> str:
70-
req_options: Dict[str, Any] = {"rpid": self.rpid, "challenge": self.challenge}
70+
req_options: Dict[str, Any] = {"rpId": self.rpid, "challenge": self.challenge}
7171
if self.timeout_ms:
7272
req_options["timeout"] = self.timeout_ms
7373
if self.allow_credentials:

tests/oauth2/test_webauthn_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def test_success_get_assertion(os_get_stub, subprocess_run_stub):
118118
"type": "get",
119119
"origin": "fake_origin",
120120
"requestData": {
121-
"rpid": "fake_rpid",
121+
"rpId": "fake_rpid",
122122
"challenge": "fake_challenge",
123123
"allowCredentials": [{"type": "public-key", "id": "fake_id_1"}],
124124
},

tests/oauth2/test_webauthn_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_GetRequest(has_allow_credentials):
8282
"type": "get",
8383
"origin": "fake_origin",
8484
"requestData": {
85-
"rpid": "fake_rpid",
85+
"rpId": "fake_rpid",
8686
"timeout": 123,
8787
"challenge": "fake_challenge",
8888
"userVerification": "preferred",

0 commit comments

Comments
 (0)