AccountSelectionContext

public protocol AccountSelectionContext : Encodable

The service returning the information required to choose the account to be used: it returns all the available accounts and authenticators and also informs whether a given authenticator is compliant with the policy required by the FIDO UAF server for the ongoing operation.

  • The accounts that have been registered with the SDK.

    Note

    Due to some language limitation Array is provided instead of Set.

    Note

    The Accounts in the provided Array are unique.

    Declaration

    Swift

    var accounts: [any Account] { get }
  • The available authenticators.

    Note

    that this may also include authenticators that cannot be used to complete the operation.

    All the available authenticators are returned, so that the users of the SDK can figure out not only whether an account authenticator can be used for the operation, but also why. For example, a developer would like to give a visual hint explaining why the Biometric authenticator for a given user cannot be used during authentication if it is not registered.

    Note

    Due to some language limitation Array is provided instead of Set.

    Note

    The Authenticators in the provided Array are unique.

    Declaration

    Swift

    var authenticators: [any Authenticator] { get }
  • The transaction confirmation data, if any, to be presented to the user for verification. If this data is present, data must be presented to the user before authenticating.

    Note

    the exact format of the message may depend on the server, e.g. a simple String or a JSON representation.

    Note

    that in the case of registration or authentication not involving transaction confirmation, this is typically empty and thus, it does not require handling.

    Declaration

    Swift

    var transactionConfirmationData: Data? { get }
  • 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 username(_:), an OperationError with noSuitableAuthenticator will be returned as a result of the operation.

    Declaration

    Swift

    func isPolicyCompliant(username: Username, aaid: String) -> Bool

    Parameters

    username

    the username of the account.

    aaid

    the AAID of the Authenticator

    Return Value

    true if the authenticator is compliant with the policy, false otherwise.