.NET SDK chokes on webauthn UI input node
Open
Nobody has claimed this yet.
bug
- Dominant language
- PHP
- Stars
- 178
- Forks
- 96
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
Kratos sends:
{"name":"identifier","type":"text","value":"","required":true,"autocomplete":"username webauthn","disabled":false,"node_type":"input"}
Resulting in:
Newtonsoft.Json.JsonSerializationException: Error converting value "username webauthn" to type 'System.Nullable`1[Ory.Kratos.Client.Model.KratosUiNodeInputAttributes+AutocompleteEnum]'. Path 'autocomplete', line 1, position 96.
---> System.ArgumentException: Requested value 'username webauthn' was not found.
at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
Which then gets shadowed by this much less useful exception:
The JSON string `...` cannot be deserialized into any schema defined
Reproducing the bug
Enable webauthn method under selfservice->methods->webauthn, e.g.
webauthn:
config:
passwordless: true
rp:
display_name: Test
# Set 'id' to the top-level domain.
id: localhost
# Set 'origin' to the exact URL of the page that prompts the user to use WebAuthn. You must include the scheme, host, and port.
origin: http://localhost:4455
enabled: true
Create a login flow, try to get the .NET SDK to deserialise it.
Relevant log output
Relevant configuration
Version
Kratos v1.3.1; NuGet Ory.Kratos.Client v1.3.8
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
None
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the generated C# model for KratosUiNodeInputAttributes and its AutocompleteEnum, then reproduce deserialization with the JSON shown in the issue. Verify how the value "username webauthn" is represented and add or update the relevant SDK test so the payload deserializes without the schema exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100