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

UserHandle data is missing in Flutter FIDO Authentication result

Open Talal0 opened this issue 1 year ago • 5 comments

Description I'm implementing Huawei FIDO Flutter plugin in my Flutter application. I have successfully registered the user using Huawei FIDO. In the authentication process, Huawei SDK returns an attested response from the authenticator, which doesn't include UserHandle in the object. My server-side FIDO requires UserHandle to complete the authentication process. I tried all possible options provided by Huawei documentation, but I'm unable to get the desired result.

Expected behavior FIDO Authenticator should return UserHandle in the Authentication response

Current behavior Not getting UserHandle in Huawei FIDO Authentication response.

Screenshots Issue

huawei_assertion_response

Plugin https://pub.dev/packages/huawei_fido huawei_fido 6.3.0+305

Environment

  • Platform: Flutter V3.0.0
  • Kit: HmsFido2Client (https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References-V1/hms-fido2-client-0000001097330041-V1)
  • OS Version Android 10
  • Phone: Huawei Y6P
  • Model(MED-LX9)
  • AppGallery (version: 12.5.2.300)
  • HSM Core (version:6.13.0.301)

Talal0 avatar Feb 15 '24 10:02 Talal0

@Talal0 Hi! ))

What parameters do you specifically need? For example, there is a request that returns some data after authentication, you can try it. There is no UserHandler in the documentation

// Then request for authentication Fido2AuthenticationResponse? authResponse = await fido2Client.getAuthenticationIntent(requestOptions);

class Fido2RegistrationResponse {

AuthenticatorAttestationResponse? authenticatorAttestationResponse;

class AuthenticatorAttestationResponse { Uint8List? attestationObject; Uint8List? clientDataJson; Uint8List? credentialId; Fido2RegistrationResponse(

Taverz avatar Mar 18 '24 06:03 Taverz

@Taverz In Android(Google PlayStore) device I'm getting UserHandle in FIDO2 authenticator response that is required at my server side FIDO2 which we have handled it. Can you please share how to convert Huawei's object Uint8List data into JSON format?

Talal0 avatar Mar 18 '24 06:03 Talal0

@Talal0

I'm not sure if there is JSON there. But you can try: Uint8List unitList; final json = String.fromCharCodes(unitList); final map =jsonDecode(json) ;

Taverz avatar Mar 18 '24 07:03 Taverz

@Talal0

Perhaps there is some other format:

final json = hex.encode(data); final json = base64.encode(data); final json = utf8.decode(data);

Taverz avatar Mar 18 '24 07:03 Taverz

@Taverz already tried it all not working

Talal0 avatar Mar 18 '24 07:03 Talal0