HMS-Core / hms-flutter-plugin

This repo contains all of Flutter HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
278 stars 139 forks source link

UserHandle data is missing in Flutter FIDO Authentication result #356

Open Talal0 opened 4 months ago

Talal0 commented 4 months ago

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

Taverz commented 3 months ago

@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(

Talal0 commented 3 months ago

@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?

Taverz commented 3 months ago

@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 commented 3 months ago

@Talal0

Perhaps there is some other format:

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

Talal0 commented 3 months ago

@Taverz already tried it all not working