isPolicyCompliant abstract method

Future<bool> isPolicyCompliant(
  1. String authenticatorAaid,
  2. String username
)

Returns whether the specified account with the provided authenticator is compliant with the policy of the server.

If a username without an authenticator that is policy compliant is provided through AccountSelectionHandler.username, a FidoErrorCode with FidoErrorCodeType.noSuitableAuthenticator will be returned as a result of the operation.

To know if a given account has at least one policy compliant authenticator, the following code can be used:

bool hasPolicyCompliantAuthenticator(String accountUsername) async {
  authenticators.forEach((authenticator) {
    if (await isPolicyCompliant(authenticator.aaid, accountUsername)) {
            return true;
        }
   });
   return false;
}

Params:

  • authenticatorAaid: the AAID of the Authenticator.
  • username: the username of the account. Returns true if the authenticator is compliant with the policy, and false otherwise.

Implementation

Future<bool> isPolicyCompliant(String authenticatorAaid, String username);