completeAuthentication abstract method

Future<AuthenticationResult> completeAuthentication(
  1. AuthenticationProcess process,
  2. String validationCode,
  3. Tuple2<String, String> userKeyPair,
  4. Future<Tuple3<String, String, String>?> tokenAndKeyPairProvider(
    1. String,
    2. String
    ),
)

Completes the authentication process of a user, by verifying the provided validation code and :

  • In the case of a sign-up, create the user data;
  • In the case of a login, re-generate keys if needed (new keys different from previous ones);

Parameters

  • process The AuthenticationProcess previously provided in the startAuthentication service
  • validationCode The validation code the user received by email/mobile phone
  • userKeyPair The key pair private, public that will be used by the user to encrypt/decrypt data;
  • tokenAndKeyPairProvider A custom function to generate an authentication token and a key pair for user

Returns

  • The result of the authentication and the related MedTechApi object corresponding to the newly authenticated user.

Implementation

Future<AuthenticationResult> completeAuthentication(AuthenticationProcess process, String validationCode, Tuple2<String, String> userKeyPair,
    Future<Tuple3<String, String, String>?> Function(String, String) tokenAndKeyPairProvider);