hms-flutter-plugin icon indicating copy to clipboard operation
hms-flutter-plugin copied to clipboard

Flutter Huawei FIDO: unable to decode FIDO registration response

Open Talal0 opened this issue 2 years ago • 0 comments

Description

Fido2RegistrationResponse? response = await fido2client.getRegistrationIntent(options);

I've integrated huawei_fido: ^6.3.0+305 in Flutter. I'm getting the FIDO2 registration object which contains "attestationObject", "clientDataJson" and "credentialId" all field types are Unit8List? but my server expects JSON format and I'm unable to decode the plugin's response into the desired JSON format .toJson() is not converting the response. Below attached the screenshot

Expected behavior

I want to get the attested registration object in this format { "id": "KEDetxZcUfinhVi6Za5nZQ", "type": "public-key", "rawId": "KEDetxZcUfinhVi6Za5nZQ", "response": { "clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoibmhrUVhmRTU5SmI5N1Z5eU5Ka3ZEaVh1Y01Fdmx0ZHV2Y3JEbUdyT0RIWSIsIm9yaWdpbiI6ImFuZHJvaWQ6YXBrLWtleS1oYXNoOk1MTHpEdll4UTRFS1R3QzZVNlpWVnJGUXRIOEdjVi0xZDQ0NEZLOUh2YUkiLCJhbmRyb2lkUGFja2FnZU5hbWUiOiJjb20uZ29vZ2xlLmNyZWRlbnRpYWxtYW5hZ2VyLnNhbXBsZSJ9", "attestationObject": "o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YViUj5r_fLFhV-qdmGEwiukwD5E_5ama9g0hzXgN8thcFGRdAAAAAAAAAAAAAAAAAAAAAAAAAAAAEChA3rcWXFH4p4VYumWuZ2WlAQIDJiABIVgg4RqZaJyaC24Pf4tT-8ONIZ5_Elddf3dNotGOx81jj3siWCAWXS6Lz70hvC2g8hwoLllOwlsbYatNkO2uYFO-eJID6A" } }

Current behavior

Screenshots Screenshot 2024-01-23 at 5 34 09 PM

Environment

  • Platform: [Flutter]

Talal0 avatar Jan 23 '24 14:01 Talal0