Package ch.nevis.mobile.sdk.api


package ch.nevis.mobile.sdk.api
Contains the MobileAuthenticationClient interface, which is the entry point to the SDK. Your application should generally create an application scoped SDK instance, by passing in a Configuration that specifies the SDK behavior. The configuration defines the URLs used to perform operations with a NEVIS Mobile Authentication backend.

To create the SDK, assuming that the Configuration has already been created (see Configuration.Builder, here is an example to setup the SDK during application startup:

 import android.content.Context;

 [...]

     public static void createMobileAuthenticationClient(Context context,
         Configuration configuration) {
         return MobileAuthenticationClientInitializer.initializer()
               .context(context)
               .configuration(configuration)
               .onError(error -> {
                   // handle error
               })
               .onSuccess(mobileAuthenticationClient -> {
                   // handle the MobileAuthenticationClient
               })
               .execute();
     }
 }
 

Authentication example:

 private void authenticateUsingOutOfBandPayload(MobileClientAuthentication client, OutOfBandPayload payload) {
     Operations operations = client.operations();
     operations.outOfBandOperation()
         .payload(payload)
         .onAuthentication(authentication ->
             authentication.authenticatorSelector((ctx, consumer) -> {
                 // select authenticator
             })
             .pinUserVerifier(pinUserVerifier)
             .fingerprintUserVerifier(fingerprintUserVerifier)
             .biometricUserVerifier(biometricUserVerifier)
             .onError(error -> {
                 // handle error
             })
             .onSuccess(sessionProvider -> {
                 // handle success
             })
             .execute())
         .onRegistration(registration -> {
             // handle registration
         })
         .onError(error -> {
             // handle out-of-band error
         })
         .execute();
 }