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
,openPinAuthenticator
andeventError
can 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.dart
for more details. - All methods that previously required a
BuildContext
no longer require those arguments and can be removed. - The following methods had their arguments or return type adjusted and will need to be updated.
registerUser
authenticateUser
getIdentityProviders
getAuthenticatedUserProfile
getAppToWebSingleSignOn
getUserProfiles
- 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.
setPreferredAuthenticator
now only resolves instead of returning booleanderegisterBiometricAuthenticator
now only resolves instead of returning booleanlogout
now only resolves instead of returning booleanauthenticateDevice
now only resolves instead of returning booleanvalidatePinWithPolicy
now only resolves instead of returning booleanauthenticateUserImplicitly
now only resolves instead of returning stringderegisterUser
now only resolves instead of returning booleanhandleRegisteredUserUrl
now takes a non-nullable string as argument for the URL
Custom registration
- Custom registration's
submitSuccessAction
now no longer requires identity provider ID - Custom registration's
submitErrorAction
now no longer requires identity provider ID
PIN registration
OneginiPinRegistrationCallback.acceptAuthenticationRequest
now only accepts apin(String)
as an argument.
Resource requests
- Resource requests have been renamed
getUnauthenticatedResource
torequestResourceUnauthenticated
getResourceAnonymous
torequestResourceAnonymous
getResource
torequestResourceAuthenticated
getResourceImplicit
torequestResourceImplicit
Mobile authentication
- Enrolling is now required before using mobile authentication with
enrollMobileAuthentication
. mobileAuthWithOtp
has been renamed tohandleMobileAuthWithOtp
PIN and biometric authentication
- You no longer have to specify the platform-specific
authenticatorId
for biometric authentication. Instead you can call authenticateUser withOWAuthenticatorType.biometric
as an argument. - Methods for getting all authenticators have been removed in favor of
getPreferredAuthenticator
andgetBiometricAuthenticator
, which can be used to see if a user hasbiometricAuthenticator
registered. - Registering and deregistering a biometric authenticator can now be done using
registerBiometricAuthenticator
andderegisterBiometricAuthenticator
. - Setting the preferred authenticator with
setPreferredAuthenticator
now also takes aOWAuthenticatorType
as 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
eventFinishRegistration
where 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
.