From e9be6b3cfc4d837d54976ac8dd70326611182118 Mon Sep 17 00:00:00 2001 From: Michiel Vrins Date: Wed, 3 May 2023 14:49:38 +0200 Subject: [PATCH 1/4] Fix a bug where fallback to pin was not working correctly on ios It was possible to pass in an available but not registered authenticator into the authenticate_user method if biometrics were available but not registered. This would result in an error instead of fallback to pin. This commit fixes that by only checking registered authenticators when authenticating user. --- .../NativeBridge/ModuleExtensions/OneginiModuleSwift+Auth.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/NativeBridge/ModuleExtensions/OneginiModuleSwift+Auth.swift b/ios/Classes/NativeBridge/ModuleExtensions/OneginiModuleSwift+Auth.swift index 3daaf9a7..512fff47 100644 --- a/ios/Classes/NativeBridge/ModuleExtensions/OneginiModuleSwift+Auth.swift +++ b/ios/Classes/NativeBridge/ModuleExtensions/OneginiModuleSwift+Auth.swift @@ -38,7 +38,7 @@ extension OneginiModuleSwift { completion(.failure(SdkError(.notFoundUserProfile).flutterError())) return } - let authenticator = SharedUserClient.instance.authenticators(.all, for: profile).first(where: { $0.type == authenticatorType }) + let authenticator = SharedUserClient.instance.authenticators(.registered, for: profile).first(where: { $0.type == authenticatorType }) bridgeConnector.toLoginHandler.authenticateUser(profile, authenticator: authenticator) { result in completion(result) From 85e727854bd908905cfeba01c078447d2207b339 Mon Sep 17 00:00:00 2001 From: Michiel Vrins Date: Wed, 3 May 2023 14:54:20 +0200 Subject: [PATCH 2/4] Fix an overflow issue on the Drawer on smaller devices --- example/lib/screens/user_screen.dart | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/example/lib/screens/user_screen.dart b/example/lib/screens/user_screen.dart index bae4b2cc..4a2f15c2 100644 --- a/example/lib/screens/user_screen.dart +++ b/example/lib/screens/user_screen.dart @@ -227,16 +227,14 @@ class _UserScreenState extends State with RouteAware { ), body: _children[_currentIndex], drawer: Drawer( - child: Column( + child: ListView( children: [ DrawerHeader( - child: Container(), - ), - ListTile( - title: Text("ProfileId: ${profileId}"), - leading: Icon(Icons.person), + child: ListTile( + title: Text("ProfileId: ${profileId}"), + leading: Icon(Icons.person), + ), ), - Divider(), ListTile( title: Text("Authenticators"), leading: Icon(Icons.lock_rounded), From 1cd2715a4c6ba3a5c5cf750a5b10eb740fe87214 Mon Sep 17 00:00:00 2001 From: Michiel Vrins Date: Wed, 3 May 2023 15:33:21 +0200 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de025ffc..bd991747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,45 @@ +## 3.0.0, May 3, 2023 +You can find the full changelog [here](https://developer.onewelcome.com/flutter/plugin/v2-x) and an overview containing the upgrade instructions [here](https://developer.onewelcome.com/flutter/plugin/v2-0). + +[iOS] Wrapper SDK now uses the latest OneWelcome iOS native SDK 12.2.2 + +* Events are now propagated using Streams and have been renamed to more accurately describe their purpose. +* Removed the following events + - eventOther + - openPinAuthenticator + - eventError +* startApplication now no longer requires a OneginiListener parameter. +* All BuildContext requirements from functions have been removed. +* Resource requests now allow absolute paths. +* Allow for Resource Requests to other resource servers than the one in the tokenserver config file, this is only possible if the server has a correct certificate. +* Updated several parameters and return types of functions. +* Functions are now fully typesafe and nullsafe due to the use of [Pigeon](https://pub.dev/packages/pigeon) internally. +* Updates several functions to no longer return a boolean status but instead resolve/reject. + - setPreferredAuthenticator + - deregisterBiometricAuthenticator + - logout + - authenticateDevice + - validatePinWithPolicy + - authenticateUserImplicitly + - deregisterUser +* submitSuccessAction and submitErrorAction for custom registration no longer require an identity provider id. +* getAppToWebSingleSignOn now returns the actual error code instead of a general error when failing. +* OneginiPinRegistrationCallback.acceptAuthenticationRequest No longer takes a map as a second argument. +* Renamed several resourceRequest functions and added a generic requestResource which takes a type as extra argument. +* Reworked error codes and added constants for all errors(wrapper and native) in lib/errors/error_codes.dart +* Reworked mobileAuthWithOtp. +* Reworked authentication + - Removed getRegisteredAuthenticators + - Removed getAllAuthenticators + - Removed registerAuthenticator + - Added deregisterBiometricAuthenticator + - Added registerBiometricAuthenticator + - Added getBiometricAuthenticator + - Added getPreferredAuthenticator + - Changed setPreferredAuthenticator + - Changed authenticateUser +* Allow sdk <4.0.0 + ## 2.0.1, March 2, 2023 Updated the README From 709f9ae4f0472c24abeb7e2ec26bf1dd1dc11b85 Mon Sep 17 00:00:00 2001 From: Michiel Vrins Date: Wed, 3 May 2023 15:34:26 +0200 Subject: [PATCH 4/4] Update versions for release --- README.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 487ffd3e..8a8b83c1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ in pubspec.yaml add this: dependencies: - onegini: 2.0.1 + onegini: 3.0.0 `flutter clean` diff --git a/pubspec.yaml b/pubspec.yaml index 69409ca8..79ec54e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: onegini description: The Onegini Flutter Plugin is a plugin that allows you to utilize the Onegini Mobile SDKs in your Flutter applications. -version: 2.0.1 +version: 3.0.0 homepage: https://www.onegini.com environment: