NMAAccountSelectionContext
@objc
public protocol NMAAccountSelectionContext : DictionaryEncodable
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
ProvidingArray
instead ofSet
to be aligned with the Swift API.Declaration
Swift
var accounts: [NMAAccount] { 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
ProvidingArray
instead ofSet
to be aligned with the Swift API.Declaration
Swift
var authenticators: [NMAAuthenticator] { 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(_:)
, anNMAOperationError
withnoSuitableAuthenticator
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
NMAAuthenticator
Return Value
true
if the authenticator is compliant with the policy,false
otherwise.