Interface Authentication

All Superinterfaces:
HttpOperation<Authentication>, Operation

public interface Authentication extends HttpOperation<Authentication>
The object that can be used to trigger an authentication operation.

Usage example:

 private void authenticate(Operations operations, String username, SessionProvider sessionProvider) {
     operations.authentication()
          .username(username)
          .sessionProvider(sessionProvider)
          .authenticatorSelector((ctx, handler) -> {
              // select authenticator
          })
          .pinUserVerifier(new PinUserVerifier() {
              @Override
              public void verifyPin(PinUserVerificationContext context, PinUserVerificationHandler handler) {
                  // verify user
              }

              @Override
              public void onValidCredentialsProvided() {
                  // If needed, do something when valid credentials are provided (like hiding the screen if using the fingerprint authenticator).
              }
          })
          .biometricUserVerifier(new BiometricUserVerifier() {
              @Override
              public void verifyBiometric(BiometricUserVerificationContext context, BiometricUserVerificationHandler handler) {
                  // verify user
              }

              @Override
              public void onValidCredentialsProvided() {
                  // If needed, do something when valid credentials are provided (like hiding the screen if using the fingerprint authenticator).
              }
          })
          .fingerprintUserVerifier(new FingerprintUserVerifier() {
              @Override
              public void verifyFingerprint(FingerprintUserVerificationContext context, FingerprintUserVerificationHandler handler) {
                  // verify user
              }

              @Override
              public void onValidCredentialsProvided() {
                  // If needed, do something when valid credentials are provided (like hiding the screen if using the fingerprint authenticator).
              }
          })
          .onError(error -> {
              // handle error
          })
          .onSuccess(result -> {
              // handle success
          })
          .execute();
 }