Upgrade instructions
This section contains upgrade instructions for the Flutter Plugin. In the release notes we mention new features and bug fixes.
Upgrade the Flutter Plugin to version 3.0.0
Event handling
- Events are now sent through event streams. To receive events, the events need to be handled using these streams.
eventOther,openPinAuthenticatorandeventErrorcan be safely removed.
Error codes
- Several wrapper error codes have been changed and have now received constants to match their codes. If your code contained hardcoded error codes in the past you should use these constants instead. See
onegini/errors/error_codes.dartfor more details. - All methods that previously required a
BuildContextno longer require those arguments and can be removed. - The following methods had their arguments or return type adjusted and will need to be updated.
registerUserauthenticateUsergetIdentityProvidersgetAuthenticatedUserProfilegetAppToWebSingleSignOngetUserProfiles
- Several methods now no longer return a boolean to indicate success or failure but instead resolve or reject based on their result. These uses will need to be updated.
setPreferredAuthenticatornow only resolves instead of returning booleanderegisterBiometricAuthenticatornow only resolves instead of returning booleanlogoutnow only resolves instead of returning booleanauthenticateDevicenow only resolves instead of returning booleanvalidatePinWithPolicynow only resolves instead of returning booleanauthenticateUserImplicitlynow only resolves instead of returning stringderegisterUsernow only resolves instead of returning booleanhandleRegisteredUserUrlnow takes a non-nullable string as argument for the URL
Custom registration
- Custom registration's
submitSuccessActionnow no longer requires identity provider ID - Custom registration's
submitErrorActionnow no longer requires identity provider ID
PIN registration
OneginiPinRegistrationCallback.acceptAuthenticationRequestnow only accepts apin(String)as an argument.
Resource requests
- Resource requests have been renamed
getUnauthenticatedResourcetorequestResourceUnauthenticatedgetResourceAnonymoustorequestResourceAnonymousgetResourcetorequestResourceAuthenticatedgetResourceImplicittorequestResourceImplicit
Mobile authentication
- Enrolling is now required before using mobile authentication with
enrollMobileAuthentication. mobileAuthWithOtphas been renamed tohandleMobileAuthWithOtp
PIN and biometric authentication
- You no longer have to specify the platform-specific
authenticatorIdfor biometric authentication. Instead you can call authenticateUser withOWAuthenticatorType.biometricas an argument. - Methods for getting all authenticators have been removed in favor of
getPreferredAuthenticatorandgetBiometricAuthenticator, which can be used to see if a user hasbiometricAuthenticatorregistered. - Registering and deregistering a biometric authenticator can now be done using
registerBiometricAuthenticatorandderegisterBiometricAuthenticator. - Setting the preferred authenticator with
setPreferredAuthenticatornow also takes aOWAuthenticatorTypeas an argument instead of a string.
Instructions for upgrading the Flutter Plugin to version 2.0.0
Due to the upgrade of the native Android SDK the following requirements are upgraded as well
- CompileSDK is now increased to 33
- Required Kotlin version is increased to 1.8.0
The Error structure has been reworked:
- This causes some of the Error codes to be changed. The new codes can be found under the updated documentation Error handling.
- Previously, iOS returned an object within the details property of a Platform Exception. This object has been slightly reworked, which causes some of its properties to be changed. The new structure, which is now also available for Android, can be found in Details Property
The Onegini.instance.userClient.registerUser function has been reworked
- Previously, two-step registration was partially implemented using the openCustomTwoStepRegistrationScreen event. This event has been replaced for the
eventFinishRegistrationwhere the user now also needs to make use of eventInitRegistration as described in Handling Events. This will allow the use of custom registration as documented in Registration with Custom IdP. - The
Onegini.instance.userClient.fetchUserProfiles()function is now deprecated and replaced forOnegini.instance.userClient.getUserProfiles();
To support multiple registered UserProfiles some functions now require an additional parameter profileId to link the action to a specific UserProfile. The functions that require changes:
authenticateUser
setPreferredAuthenticator and deregisterAuthenticator will now only set the preferred or deregister the authenticator of the currently authenticated user. Previously, it would allow the user to perform this action using the first registered user on a device.
Instructions for upgrading the Flutter Plugin to version 1.2.0
Bump the compile- and target-SDK of your application to at least version 32.