Instruction for upgrading the Onegini Android SDK to version 8.0

When upgrading to version 8.0 some changes have to be applied in the end application:

Authenticator registration

The OneginiAuthenticatorRegistrationHandler returns additional object CustomAuthenticatorInfo containing additional information when registering a custom authenticator. In case of other authenticator the parameter will be null.

  void onSuccess(CustomAuthenticatorInfo customAuthenticatorInfo);

  void onError(OneginiAuthenticatorRegistrationError error);

User authentication

The OneginiAuthenticationHandler returns additional object CustomAuthenticatorInfo containing additional information when authenticating with a custom authenticator. In case of other authenticator the parameter will be null.

  void onSuccess(UserProfile userProfile, CustomAuthenticatorInfo customAuthenticatorInfo);

  void onError(OneginiAuthenticationError error);

Mobile authentication

The OneginiMobileAuthenticationHandler#onSuccess() returns additional object CustomAuthenticatorInfo containing additional information when authenticating with a custom authenticator. In case of other authenticator the parameter will be null.

  void onSuccess(CustomAuthenticatorInfo customAuthenticatorInfo);

Firebase Cloud Messaging

Starting from version 8.0.0 the Onegini SDK supports the Firebase Cloud Messaging (FCM) instead of the Google Cloud Messaging (GCM) for sending push notifications and it is strongly recommended to upgrade your application.

Migration

First you need to set up the FCM in the Firebase Console as described in the Token Server documentation.

In order to migrate your application please refer to the Google Documentation

Method for handling push notifications from the UserClient class has been removed:

public void handleMobileAuthWithPushRequest(final Bundle pushMessage, final OneginiMobileAuthenticationHandler mobileAuthenticationHandler);

all usages should be replace with a new method from the same class:

public void handleMobileAuthWithPushRequest(final RemoteMessage pushMessage, final OneginiMobileAuthenticationHandler mobileAuthenticationHandler);

Behavior changes

Incoming push messages will no longer cause the device's screen to be turned on so the user may not notice the authentication request. You should implement a notification mechanism. An example is implemented in the latest version of Onegini Example Application which is available on GitHub.

User authentication

The authenticateUser method behaviour change

In previous versions of the SDK calling method UserClient#authenticateUser() for already authenticated UserProfile was returning onSuccess without forcing the user to reauthenticate.

Starting from version 8.0.0 the method will logout the current user and will try to authenticate him again - user interaction will be required. It is strongly recommended to first check, if UserProfile isn't already authenticated, by calling the method UserProfile#getAuthenticatedUserProfile() which will return UserProfile of currently authenticated user, or null, if no user is currently authenticated.

The reauthenticateUser method removal

Starting from version 8.0.0 the method UserClient#reauthenticateUser has been removed from the SDK. The method UserClient#authenticateUser should be used instead, its behavior has been changed to always enforce user authentication, just like the reauthenticateUser method did.