-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
AuthenticatorAttestationRawResponse attestationResponse getting null. #338
Comments
Hello, |
Hello |
@anandsb84 And have you made any progress here? You could try to manually deserialize the data, byt most probably there is a base64 encoding issues |
Hello, |
@anandsb84 Make sure you decode the byte[] as Base64url not just Base64. |
Hello everyone, in one of the projects i migrate to lib v3, encountered that during deserialization clientDataJson is null, although it is present in the json make response
If you do the conversion manually everything works.
What did I miss? The project has newtonsoft json, can it influence? |
@namespacedevbox In v3 we shiften towards using System.Text.Json. I have a theory why this is happening and people are getting null object:
To solve it, you either need to either: Ideally, we should make this a non-issue by providing a way to make it compatible with newtonsoft. |
@abergs Thanks for the answer, newtonsoft is used for only for validations, fido2 objects deserializing by system.text.json, in raw json i have a ClientDataJson, but after
|
Huh, that's interesting... Can you share that console app to help me diagnose it? |
I have another guess on what might be wrong, but I have not verified it so take it with a grain of salt. When I was looking at the AuthenticatorAssertionRawResponse line 43, I noticed we've named the field This didn't matter when using newtonsoft, but will not work using System.Text.Json (Unless you change the option to allow case-insensitive property matching!) https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/character-casing#case-insensitive-property-matching Tricky one to discover, definitely not intuitive. Would be interesting to explore ways to make this more discoverable and easy to diagnose. |
It really worked, problem solved. But I look in your sample
and in lib 'clientDataJSON'
When it passes through the controller, it ignores the case, and if it is explicitly deserialized, there will be an error. |
Thanks @namespacedevbox. We should update the sample to minimize the risk of setting people up for failure. |
Just as a note: |
Hi,
I had taken a reference from sample demo for passwordless.
where we have a method called MakeCredential
[HttpPost]
[Route("/makeCredential")]
public async Task MakeCredential([FromBody] AuthenticatorAttestationRawResponse attestationResponse, CancellationToken cancellationToken)
In demo we do get the attestationResponse value but when we try to implement the same thing in our project,
the response which we get for attestationResponse is null although when checked in network tab the payload is passed.
Below is the screen shot of payload which we are passing.
Could you please help us to figure out this issue?
The text was updated successfully, but these errors were encountered: