Authentication class Null safety

The object that can be used to trigger an authentication operation.

Usage example:

  class AuthenticatorSelectorImpl implements AuthenticatorSelector {
    @override
    void selectAuthenticator(
      AuthenticatorSelectionContext context,
      AuthenticatorSelectionHandler handler,
    ) {
      handler.aaid(aaid);
    }
  }

  class PinUserVerifierImpl implements PinUserVerifier {
    @override
    void verifyPin(
      PinUserVerificationContext context,
      PinUserVerificationHandler handler,
    ) {
      handler.verifyPin(pin);
    }
  }

  class BiometricUserVerifierImpl implements BiometricUserVerifier {
    @override
    void verifyBiometric(
      BiometricUserVerificationContext context,
      BiometricUserVerificationHandler handler,
    ) {
      handler.verifyBiometric();
    }
  }

  [...]
  Future<void> authenticate({
    required MobileAuthenticationClient client,
    required String username,
    SessionProvider? sessionProvider,
  }) async {
    await client.operations.authentication
      .username(username)
      .sessionProvider(sessionProvider)
      .authenticatorSelector(AuthenticatorSelectorImpl(...))
      .pinUserVerifier(PinUserVerifierImpl(...))
      .biometricUserVerifier(BiometricUserVerifierImpl(...))
      .onSuccess((authorizationProvider) {
        // handle success
      })
      .onError((error) {
        // handle error
      })
      .execute();
  }
  [...]
Inheritance

Constructors

Authentication()

Properties

hashCode → int
The hash code for this object.
read-onlyinherited
runtimeType → Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

authenticatorSelector(AuthenticatorSelector authenticatorSelector) Authentication
Specifies the object that will take care of the selection of the authenticator to be used.
biometricUserVerifier(BiometricUserVerifier biometricUserVerifier) Authentication
Specifies the object that will take care of the biometric user verification.
devicePasscodeUserVerifier(DevicePasscodeUserVerifier devicePasscodeUserVerifier) Authentication
Specifies the object that will take care of the device passcode user verification.
execute() → Future<void>
Executes the operation asynchronously.
inherited
fingerprintUserVerifier(FingerprintUserVerifier fingerprintUserVerifier) Authentication
Specifies the object that will take care of the fingerprint user verification.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
onError(dynamic onError(AuthenticationError)) Authentication
Specifies the object that will be invoked if the authentication failed.
onSuccess(dynamic onSuccess(AuthorizationProvider?)) Authentication
Specifies the object that will be invoked if the authentication was successful.
pinUserVerifier(PinUserVerifier pinUserVerifier) Authentication
Specifies the object that will take care of the PIN user verification.
requestHeaders(RequestHeaders requestHeaders) Authentication
Specifies the additional request headers that must be included in the HTTP requests sent by the operation.
inherited
retryPolicyObtainingAuthorizationProvider(RetryPolicy retryPolicy) Authentication
The retry policy to be used to obtain an AuthorizationProvider after the user authenticates successfully. If obtaining an AuthorizationProvider fails on the first try, the SDK will retry according to the provided RetryPolicy. This policy is used when the backend is the Identity Suite and cookies are created after a successful authentication.
sessionProvider(SessionProvider sessionProvider) Authentication
Specifies the session provider that must be used to authenticate.
toString() → String
A string representation of this object.
inherited
username(String username) Authentication
Specifies the username that must be used to authenticate.

Operators

operator ==(Object other) → bool
The equality operator.
inherited