authenticate method
Returns a solution to the challenge
from relyingParty
Implementation
Future<AuthenticateResponseType> authenticate(
String relyingPartyId,
String challenge,
int? timeout,
String? userVerification,
List<AllowCredentialType>? allowCredentials,
) async {
try {
final r = await _platform.authenticate(
relyingPartyId,
challenge,
timeout,
userVerification,
allowCredentials,
);
return r;
} on PlatformException catch (e) {
switch (e.code) {
case 'cancelled':
throw PasskeyAuthCancelledException();
case 'android-no-credential':
throw MissingGoogleSignInException();
default:
if (e.code.startsWith('android-unhandled')) {
throw UnhandledAuthenticatorException(e.code, e.message, e.details);
} else if (e.code.startsWith('ios-unhandled')) {
throw UnhandledAuthenticatorException(e.code, e.message, e.details);
} else {
rethrow;
}
}
}
}