authenticate method

Future<void> authenticate(
  1. ClientAuthContext clientAuthContext,
  2. IdentityProvider identityProvider,
  3. String tokenString, {
  4. required void onSuccess(
    1. bool
    ),
  5. required void onError(
    1. SyneriseError error
    ),
})

This function authenticates a client using an identity provider, clientAuthContext and a token string.

Args: clientAuthContext (ClientAuthContext): An object that contains information about the client's authentication context. identityProvider (IdentityProvider): The identityProvider parameter is an object that represents the identity provider used for authentication. tokenString (String): The tokenString parameter is a string that represents an authentication token.

Implementation

Future<void> authenticate(ClientAuthContext clientAuthContext,
    IdentityProvider identityProvider, String tokenString,
    {required void Function(bool) onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<bool> result = await _methods.authenticate(
      clientAuthContext, identityProvider, tokenString);

  result.onSuccess((result) {
    onSuccess(result);
  }).onError((error) {
    onError(error);
  });
}