Skip to content

Older versions

Instruction for upgrading the Onegini Android SDK to version 7.0

When upgrading from old SDK 6.X version to the version 7.0, several changes have to be applied in the end application:

Retrofit 2

Starting from version 7.0.0 the Onegini SDK uses the Retrofit 2 for all internal communication. For resource calls a secured OkHttpClient from OkHttp 3 is exposed. The app can use the OkHttpClient to make resource calls using both Retrofit 2.x and Retrofit 1.x (with an additional 3rd party library).

Example how to use OkHttpClient with Retrofit 2.x

1
2
3
4
5
    final OneginiClient oneginiClient = OneginiSDK.getOneginiClient(context);
    final Retrofit retrofit = new Retrofit.Builder()
        .client(oneginiClient.getDeviceClient().getAnonymousResourceOkHttpClient())
        .baseUrl(oneginiClient.getConfigModel().getResourceBaseUrl() + "/") // In Retrofit 2.X the base URL should end with '/'
        .build();

Example how to use OkHttpClient with Retrofit 1.x

With additional dependency added to the app project: com.jakewharton.retrofit:retrofit1-okhttp3-client

1
2
3
4
5
    final OneginiClient oneginiClient = OneginiSDK.getOneginiClient(context);
    final RestAdapter restAdapter = new RestAdapter.Builder()
        .setClient(new Ok3Client(oneginiClient.getDeviceClient().getAnonymousResourceOkHttpClient()))
        .setEndpoint(oneginiClient.getConfigModel().getResourceBaseUrl())
        .build();

Mobile authentication enrollment

In previous versions the SDK was exposing the enrollUserForMobileAuthentication(final String registrationId, final OneginiMobileAuthenticationEnrollmentHandler enrollmentHandler) method to allow the end user to register for mobile authentication with push.

Starting from 7.0.0 the push enrollment is a two step action. Firstly, the authenticated user has to enroll for the mobile authentication feature using new method: UserClient#enrollUserForMobileAuth(final OneginiMobileAuthEnrollmentHandler handler). Only when user has succeeded to enroll for mobile authentication, he's then allowed to register for a mobile authentication with push using GCM registration ID: UserClient#enrollUserForMobileAuthWithPush(final String registrationId, final OneginiMobileAuthWithPushEnrollmentHandler enrollmentHandler). Please check the mobile authentication documentation for details.

OneginiError

Starting from version 7.0.0 the OneginiError class implements the Throwable interface.

The public String getErrorDescription() method doesn't exist anymore. Instead the public String getMessage() should be used.

The public Exception getException() method doesn't exist anymore. Instead the public Throwable getCause() should be used.

Renamed methods and handlers

From now on we distinguish two types of mobile authentication: with Push and with OTP. Therefore we renamed some method and handlers names listed below. The list uses a pattern "previous naming -> currently naming":

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
handleMobileAuthenticationRequest - > handleMobileAuthWithPushRequest

setMobileAuthenticationRequestHandler -> setMobileAuthWithPushRequestHandler
setMobileAuthenticationPinRequestHandler -> setMobileAuthWithPushPinRequestHandler
setMobileAuthenticationFingerprintRequestHandler -> setMobileAuthWithPushFingerprintRequestHandler
setMobileAuthenticationCustomRequestHandler -> setMobileAuthWithPushCustomRequestHandler
setMobileAuthenticationFidoRequestHandler -> setMobileAuthWithPushFidoRequestHandler

OneginiMobileAuthenticationRequestHandler -> OneginiMobileAuthWithPushRequestHandler
OneginiMobileAuthenticationPinRequestHandler -> OneginiMobileAuthWithPushPinRequestHandler
OneginiMobileAuthenticationFingerprintRequestHandler -> OneginiMobileAuthWithPushFingerprintRequestHandler
OneginiMobileAuthenticationCustomRequestHandler -> OneginiMobileAuthWithPushCustomRequestHandler
OneginiMobileAuthenticationFidoRequestHandler -> OneginiMobileAuthWithPushFidoRequestHandler

The reason is to be more precise which mobile authentication type the handler is (push or OTP). From now on we have shortened MobileAuthentication into MobileAuth for shorter and cleaner names.

OpenID Connect

The OpenID Connect functionality is not supported anymore. Therefore:

  • The UserClient#getOpenIdUserInfo() method has been removed
  • The com.nimbusds:nimbus-jose-jwt dependency has been removed
  • Apache Commons IO (commons-io:commons-io:2.5) dependency has been added.

Instruction for upgrading the Onegini Android SDK to version 6.06.00

When upgrading from old SDK version to the version 6.06.00, there is one small change you need to apply in your application if you use FIDO. Otherwise the changes are transparent and you don't have to apply below change.

Google Guava dependency

This library is used internally by FIDO SDK client and from now on we don't include Guava as Onegini's compiled dependency. Instead the Guava has to be provided by the end app in case when FIDO is used in the app.

If this is the case for you then you should add compile 'com.google.guava:guava:19.0' to your app's gradle file.

Instruction for upgrading the Onegini Android SDK to version 6.04.00

When upgrading from old SDK version to the version 6.04.00, there is one small change you need to apply in your application:

OneginiCreatePinRequestHandler

The method startPinCreation from OneginiCreatePinRequestHandler interface has now additional parameter named pinLength:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  /**
   * Method called when new PIN creation request is made.
   *
   * The method will be called only once per PIN creation process.
   *
   * @param userProfile instance of {@link UserProfile} that describes which user creates the PIN
   * @param callback    instance of {@link OneginiPinCallback} to send request's response back to the SDK
   * @param pinLength   int required pin length
   */
  void startPinCreation(UserProfile userProfile, OneginiPinCallback callback, int pinLength);

You can use newly added parameter to check the required pin length when building UI with dynamic number of PIN inputs.

Instruction for upgrading the Onegini Android SDK to version 6.03

When upgrading from old SDK version to the version 6.03, several changes have to be applied in the end application:

OneginiRegistrationRequestHandler

The OneginiRegistrationRequestHandler interface implementation is now mandatory and has to be passed to the SDK via OneginiClientBuilder constructor.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
/**
 * Interface to handle user's registration action.
 */
public interface OneginiRegistrationRequestHandler {

  /**
   * Method called when user has to authenticate in a web browser.
   *
   * @param URL {@link Uri} url that was opened
   */
  void startRegistration(Uri URL, OneginiRegistrationCallback registrationCallback);
}
The OneginiRegistrationRequestHandler#startRegistration() method is called by the SDK whenever user has to authenticate himself in the web browser. In such case you should open an external web browser using provided url.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
/**
 * Interface to handle user registration request.
 */
public interface OneginiRegistrationCallback {

  /**
   * Method used to pass the registration callback returned by the web browser
   * @param uri the uri that was returned by the Token Server after
   */
  void handleRegistrationCallback(final Uri uri);

  /**
   * Method used to deny the registration action.
   */
  void denyRegistration();
}
The OneginiRegistrationCallback#handleRegistrationCallback() method has to be used to pass the Uri returned after successful authentication in web browser.

The OneginiRegistrationCallback#denyRegistration() method has to be used when authentication in browser was canceled or incomplete, so the registration flow can be aborted.

OneginiURLHandler

The OneginiURLHandler class has been removed, because it's functionality is duplicated by the mandatory OneginiRegistrationRequestHandler interface.

UserClient#handleRegistrationCallback

The UserClient#handleRegistrationCallback method has been removed, because it's functionality is duplicated by the mandatory OneginiRegistrationCallback interface.

Instruction for upgrading the Onegini Android SDK to version 5.03

When upgrading from old SDK version to the version 5.03, several changes have to be applied in the end application:

Pin dialogs

From now on "Create PIN" and "Login with PIN" dialogs use newly added UserProfile ValueObject which can be used to customize those screens with user's profile specific data.

OneginiCreatePinDialog

The com.onegini.mobile.sdk.android.library.utils.dialogs.OneginiCreatePinDialog interface uses new UserProfile userProfile ValueObject as first parameter in createPin method:

1
2
3
4
  @Override
  public void createPin(final UserProfile userProfile, final OneginiPinProvidedHandler oneginiPinProvidedHandler) {
    // ...
  }

OneginiCurrentPinDialog

The com.onegini.mobile.sdk.android.library.utils.dialogs.OneginiCurrentPinDialog interface uses new UserProfile userProfile ValueObject as first parameter in getCurrentPin method:

1
2
3
4
  @Override
  public void getCurrentPin(final UserProfile userProfile, final OneginiPinProvidedHandler oneginiPinProvidedHandler) {
    // ...
  }

Fingerprint dialog

The com.onegini.mobile.sdk.android.library.utils.dialogs.OneginiFingerprintDialog interface uses new UserProfile userProfile ValueObject as first parameter in showFingerprintPopup method:

1
2
3
4
  @Override
  public void showFingerprintPopup(final UserProfile userProfile) {
    // ...
  }

Push authentication dialogs

Push authentication dialogs now use new UserProfile ValueObject that can be used to check which user profile is a receiver of the push message confirmation.

AlertInterface

The com.onegini.mobile.sdk.android.library.utils.dialogs.AlertInterface interface uses new UserProfile receiver ValueObject as parameter in showAlert method:

1
2
3
4
5
  @Override
  public void showAlert(final String title, final String message, final UserProfile receiver, final String positiveButton,
                        final String negativeButton, final AlertHandler alertHandler) {
    // ...
  }

ConfirmationWithPin

The com.onegini.mobile.sdk.android.library.utils.dialogs.ConfirmationWithPin interface uses new UserProfile receiver ValueObject as parameter in showConfirmation method:

1
2
3
4
5
  @Override
  public void showConfirmation(final String title, final String message, final UserProfile receiver, final int attemptCount, final int maxAllowedAttempts,
                               final ConfirmationWithPinHandler confirmationWithPinHandler) {
    // ...
  }

ConfirmationWithFingerprint

The com.onegini.mobile.sdk.android.library.utils.dialogs.ConfirmationWithFingerprint interface uses new UserProfile receiver ValueObject as parameter in showConfirmation method:

1
2
3
4
  @Override
  public void showConfirmation(final String title, final UserProfile receiver, final ConfirmationWithFingerprintHandler confirmationWithFingerprintHandler) {
    // ...
  }

OneginiClientAuthenticationHandler

The com.onegini.mobile.sdk.android.library.handlers.OneginiClientAuthenticationHandler interface has new requestErrorInvalidProfile() method that's being called when the Token Server returns invalid_profile error.