|
| 1 | +## 3.0.0 |
| 2 | + |
| 3 | +### Dependencies update |
| 4 | + |
| 5 | +1. Switch to flutter_web_auth_2 package |
| 6 | + Replace the legacy [flutter_web_auth](https://pub.dev/packages/flutter_web_auth) package with the new [flutter_web_auth_2](https://pub.dev/packages/flutter_web_auth_2). Since the `flutter_web_auth` package is no longer maintained, we have to switch to the new package to support the latest Flutter versions. |
| 7 | + |
| 8 | + **flutter_web_auth_2** setup guide: |
| 9 | + |
| 10 | + - iOS: No additional setup required |
| 11 | + - Android: In order to capture the callback URL. You wil need to add the following activity to your AndroidManifest.xml file. Replace `YOUR_CALLBACK_URL_SCHEME_HERE` with your actual callback URL scheme (io.logto etc.). |
| 12 | + |
| 13 | + ```xml |
| 14 | + <manifest> |
| 15 | + <application> |
| 16 | + |
| 17 | + <activity |
| 18 | + android:name="com.linusu.flutter_web_auth_2.CallbackActivity" |
| 19 | + android:exported="true"> |
| 20 | + <intent-filter android:label="flutter_web_auth_2"> |
| 21 | + <action android:name="android.intent.action.VIEW" /> |
| 22 | + <category android:name="android.intent.category.DEFAULT" /> |
| 23 | + <category android:name="android.intent.category.BROWSABLE" /> |
| 24 | + <data android:scheme="YOUR_CALLBACK_URL_SCHEME_HERE" /> |
| 25 | + </intent-filter> |
| 26 | + </activity> |
| 27 | + |
| 28 | + </application> |
| 29 | + </manifest> |
| 30 | + ``` |
| 31 | + |
| 32 | + Remove any `android:taskAffinity` entries and add set `android:launchMode="singleTop"` to the main activity in the AndroidManifest.xml file. |
| 33 | + |
| 34 | + - Web: Create a new endpoint to capture the callback URL and sent it back to the application using `postMessage` API. The endpoint should be the same as the `redirectUri` parameter in the `signIn` method. |
| 35 | + |
| 36 | + ```html |
| 37 | + <!DOCTYPE html> |
| 38 | + <title>Authentication complete</title> |
| 39 | + <p> |
| 40 | + Authentication is complete. If this does not happen automatically, please |
| 41 | + close the window. |
| 42 | + </p> |
| 43 | + <script> |
| 44 | + function postAuthenticationMessage() { |
| 45 | + const message = { |
| 46 | + "flutter-web-auth-2": window.location.href, |
| 47 | + }; |
| 48 | + |
| 49 | + if (window.opener) { |
| 50 | + window.opener.postMessage(message, window.location.origin); |
| 51 | + window.close(); |
| 52 | + } else if (window.parent && window.parent !== window) { |
| 53 | + window.parent.postMessage(message, window.location.origin); |
| 54 | + } else { |
| 55 | + localStorage.setItem("flutter-web-auth-2", window.location.href); |
| 56 | + window.close(); |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + postAuthenticationMessage(); |
| 61 | + </script> |
| 62 | + ``` |
| 63 | + |
| 64 | + Please check the setup guide in the [flutter_web_auth_2](https://pub.dev/packages/flutter_web_auth_2#setup) package for more details. |
| 65 | + |
| 66 | +2. Other patches |
| 67 | + - bump crypto package |
| 68 | + - bump jose package |
| 69 | + - bump json_annotation package |
| 70 | + |
| 71 | +### New features |
| 72 | + |
| 73 | +1. With the latest `flutter_web_auth_2` package, this SDK now supports the Web platform. You can use Logto dart SDK in your Flutter web projects as well. Officially supported platforms are iOS, Android, and Web. |
| 74 | + |
| 75 | +### Bug fixes |
| 76 | + |
| 77 | +1. Fix the namespace missing issue when building with the latest Gradle version on Android. ([#75](https://github.com/logto-io/dart/issues/75)) |
| 78 | +2. Fix the issue that the webview is not closing after the user completes the OAuth2 authorization flow on Android. ([60](https://github.com/logto-io/dart/issues/60)) |
| 79 | +3. Fix the issue on Android that the sign-in session is not cleared after the user signs out. |
| 80 | + |
| 81 | +### Breaking changes |
| 82 | + |
| 83 | +`logtoClient.signOut` method now requires a `redirectUri` parameter. For iOS platform, this parameter is useless, but for Android and Web platforms which require an additional `end_session` request to clean up the sign-in session, this parameter will be used as the `post_logout_redirect_uri` parameter in the `end_session` request. |
| 84 | + |
| 85 | +User experience on iOS will not be affected by this change, but for Android and Web platforms, when users click the sign-out button, an `end_session` request will be triggered by opening a webview with the `post_logout_redirect_uri` parameter set to the `redirectUri` value. This will clear the sign-in session and redirect the user back to the `redirectUri` page. |
| 86 | + |
1 | 87 | ## 2.1.0
|
2 | 88 |
|
3 | 89 | ### New features
|
|
0 commit comments