From dcf799bfecde5d013f20d36fce8ab98fbd28fbf3 Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Thu, 14 Mar 2024 14:40:58 +0000 Subject: [PATCH 1/6] Update the Flutter QS to include HTTPS redirect URLs on iOS/macOS --- .../quickstart/native/flutter/01-login.md | 86 +++++++++++++++++-- .../flutter/_configure_urls_interactive.md | 50 ++++++----- .../quickstart/native/flutter/files/main.md | 8 +- .../quickstart/native/flutter/interactive.md | 38 ++++++-- .../quickstart/native/ios-swift/01-login.md | 8 +- .../quickstart/native/ios-swift/download.md | 2 +- .../native/ios-swift/interactive.md | 2 +- 7 files changed, 149 insertions(+), 45 deletions(-) diff --git a/articles/quickstart/native/flutter/01-login.md b/articles/quickstart/native/flutter/01-login.md index 23dc29a74a..d0c303707b 100644 --- a/articles/quickstart/native/flutter/01-login.md +++ b/articles/quickstart/native/flutter/01-login.md @@ -26,7 +26,7 @@ github: Auth0 allows you to quickly add authentication and access user profile information in your app. This guide demonstrates how to integrate Auth0 with a Flutter app using the [Auth0 Flutter SDK](https://github.com/auth0/auth0-flutter). :::note -The Flutter SDK currently only supports Flutter app running on Android, iOS, and macOS platforms. +The Flutter SDK currently only supports Flutter apps for Android, iOS, and macOS. ::: ## Getting started @@ -35,7 +35,49 @@ This quickstart assumes you already have a [Flutter](https://flutter.dev/) app u You should also be familiar with the [Flutter command line tool](https://docs.flutter.dev/reference/flutter-cli). -<%= include('_configure_urls_interactive') %> +Finally, you will need a **Native** Auth0 application. If you don’t have a Native Auth0 application already, [create one](/get-started/auth0-overview/create-applications/native-apps) before continuing. Avoid using other application types, as they have different configurations and may cause errors. + +### Configure the callback and logout URLs + +The callback and logout URLs are the URLs that Auth0 invokes to redirect back to your app. Auth0 invokes the callback URL after authenticating the user, and the logout URL after removing the session cookie. + +If the callback and logout URLs are not set, users will be unable to log in and out of the app and will get an error. + +Go to the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application and add the following URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the platform of your app. If you have a [custom domain](/customize/custom-domains), use this instead of the Auth0 domain from the settings page. + +::: note +On Android, the value of the `SCHEME` placeholder can be `https` or some other custom scheme. `https` schemes require enabling [Android App Links](https://auth0.com/docs/get-started/applications/enable-android-app-links-support). + +On iOS 17.4+ and macOS 14.4+ it is possible to use Universal Links (`https` scheme) as callback and logout URLs. When enabled, the SDK will fall back to using a custom URL scheme on older iOS / macOS versions –your app's [bundle identifier](https://developer.apple.com/documentation/appstoreconnectapi/bundle_ids). +**This feature requires Xcode 15.3+ and a paid Apple Developer account**. +::: + +#### Android + +```text +SCHEME://${account.namespace}/android/YOUR_PACKAGE_NAME/callback +``` + +#### iOS + +```text +https://${account.namespace}/ios/YOUR_BUNDLE_IDENTIFIER/callback, +YOUR_BUNDLE_IDENTIFIER://${account.namespace}/ios/YOUR_BUNDLE_IDENTIFIER/callback +``` + +#### macOS + +```text +https://${account.namespace}/macos/YOUR_BUNDLE_IDENTIFIER/callback, +YOUR_BUNDLE_IDENTIFIER://${account.namespace}/macos/YOUR_BUNDLE_IDENTIFIER/callback +``` + +For example, if your iOS bundle identifier were `com.example.MyApp` and your Auth0 domain were `example.us.auth0.com`, then this value would be: + +```text +https://example.us.auth0.com/ios/com.example.MyApp/callback, +com.example.MyApp://example.us.auth0.com/ios/com.example.MyApp/callback +``` ## Install the Auth0 Flutter SDK @@ -81,13 +123,37 @@ Run **Sync Project with Gradle Files** inside Android Studio to apply your chang ## Configure iOS/macOS -If you are not developing for the iOS or macOS platform, skip this step. +If you are not developing for the iOS or macOS platforms, skip this step. + +::: warning +This step requires a paid Apple Developer account. It is needed to use Universal Links as callback and logout URLs. Skip this step to use a custom URL scheme instead. +::: + +#### Configure the Team ID and bundle identifier + +Go to the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application, scroll to the end, and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to your app's bundle identifier. + +

Screenshot of the iOS section inside the Auth0 application settings page

-You need to register your bundle identifier as a custom URL scheme so the callback and logout URLs can reach your app. +This will add your app to your Auth0 tenant's `apple-app-site-association` file. -In Xcode, go to the **Info** tab of your app target settings. In the **URL Types** section, select the **+** button to add a new entry. Then enter `auth0` into the **Identifier** field and `$(PRODUCT_BUNDLE_IDENTIFIER)` into the **URL Schemes** field. +#### Add the associated domain capability -

Custom URL Scheme

+Open your app in Xcode by running `open ios/Runner.xcworkspace` (or `open macos/Runner.xcworkspace` for macOS). Go to the **Signing and Capabilities** [tab](https://developer.apple.com/documentation/xcode/adding-capabilities-to-your-app#Add-a-capability) of the **Runner** target settings, and press the **+ Capability** button. Then select **Associated Domains**. + +

Screenshot of the capabilities library inside Xcode

+ +Next, add the following [entry](https://developer.apple.com/documentation/xcode/configuring-an-associated-domain#Define-a-service-and-its-associated-domain) under **Associated Domains**: + +```text +webcredentials:${account.namespace} +``` + +If you have a [custom domain](/customize/custom-domains), use this instead of the Auth0 domain from the settings page. + +::: note +For the associated domain to work, your app must be signed with your team certificate **even when building for the iOS simulator**. Make sure you are using the Apple Team whose Team ID is configured in the settings page of your Auth0 application. +::: ## Add login to your app @@ -129,8 +195,10 @@ Next, redirect your users to the Auth0 Universal Login page using `webAuthentica if (_credentials == null) { ElevatedButton( onPressed: () async { + // Use a Universal Link callback URL on iOS 17.4+ / macOS 14.4+ + // useHTTPS is ignored on Android final credentials = - await auth0.webAuthentication().login(); + await auth0.webAuthentication().login(useHTTPS: true); setState(() { _credentials = credentials; @@ -177,7 +245,9 @@ See this example of an `ElevatedButton` widget that logs the user out of the app ```dart ElevatedButton( onPressed: () async { - await auth0.webAuthentication().logout(); + // Use a Universal Link logout URL on iOS 17.4+ / macOS 14.4+ + // useHTTPS is ignored on Android + await auth0.webAuthentication().logout(useHTTPS: true); setState(() { _credentials = null; diff --git a/articles/quickstart/native/flutter/_configure_urls_interactive.md b/articles/quickstart/native/flutter/_configure_urls_interactive.md index 7048f366b6..8edfa83243 100644 --- a/articles/quickstart/native/flutter/_configure_urls_interactive.md +++ b/articles/quickstart/native/flutter/_configure_urls_interactive.md @@ -2,44 +2,52 @@ To use Auth0 services, you need to have an application set up in the Auth0 Dashboard. The Auth0 application is where you will configure how you want authentication to work for your project. -:::note -The URLs below make use of a `SCHEME` placeholder, and this value varies depending on what platform you're working with. On Android, this can be `https` or some other custom scheme. On iOS/macOS, this is your app's [bundle identifier](https://developer.apple.com/documentation/appstoreconnectapi/bundle_ids). -::: - ### Configure an Auth0 application -Use the interactive selector to create a new "Native Application", or select an existing application that represents the project you want to integrate with. Every application in Auth0 is assigned an alphanumeric, unique client ID that your application code will use to call Auth0 APIs through the SDK. +Use the interactive selector to create a new Auth0 application or select an existing **Native** Auth0 application. Every application in Auth0 is assigned an alphanumeric, unique client ID that your application code will use to call Auth0 APIs through the SDK. Any settings you configure using this quickstart will automatically update for your application in the Dashboard, which is where you can manage your applications in the future. If you would rather explore a complete configuration, you can view a sample app instead. -### Configure Callback URLs +### Configure the callback and logout URLs -A callback URL is a URL in your app that you would like Auth0 to redirect users to after they have authenticated. If not set, users will not be returned to your app after they log in. +The callback and logout URLs are the URLs that Auth0 invokes to redirect back to your app. Auth0 invokes the callback URL after authenticating the user, and the logout URL after removing the session cookie. -::: note -If you are following along with our sample project, set this to one of the following URLs, depending on your platform: +If the callback and logout URLs are not set, users will be unable to log in and out of the app and will get an error. -**Android**: `SCHEME://${account.namespace}/android/YOUR_PACKAGE_NAME/callback` +Set the callback and logout URLs to the following value, depending on your platform. -**iOS**: `YOUR_BUNDLE_ID://${account.namespace}/ios/YOUR_BUNDLE_ID/callback` +::: note +On Android, the value of the `SCHEME` placeholder can be `https` or some other custom scheme. `https` schemes require enabling [Android App Links](https://auth0.com/docs/get-started/applications/enable-android-app-links-support). -**macOS**: `YOUR_BUNDLE_ID://${account.namespace}/macos/YOUR_BUNDLE_ID/callback` +On iOS 17.4+ and macOS 14.4+ it is possible to use Universal Links (`https` scheme) as callback and logout URLs. When enabled, the SDK will fall back to using a custom URL scheme on older iOS / macOS versions –your app's [bundle identifier](https://developer.apple.com/documentation/appstoreconnectapi/bundle_ids). +**This feature requires Xcode 15.3+ and a paid Apple Developer account**. ::: -### Configure Logout URLs +#### Android -A logout URL is a URL in your app that you would like Auth0 to redirect users to after they have logged out. If not set, users will not be able to log out from your app and will receive an error. +```text +SCHEME://${account.namespace}/android/YOUR_PACKAGE_NAME/callback +``` -::: note -If you are following along with our sample project, set this to one of the following URLs, depending on your platform: +#### iOS -**Android**: `SCHEME://${account.namespace}/android/YOUR_PACKAGE_NAME/callback` +```text +https://${account.namespace}/ios/YOUR_BUNDLE_IDENTIFIER/callback, +YOUR_BUNDLE_IDENTIFIER://${account.namespace}/ios/YOUR_BUNDLE_IDENTIFIER/callback +``` -**iOS**: `YOUR_BUNDLE_ID://${account.namespace}/ios/YOUR_BUNDLE_ID/callback` +#### macOS -**macOS**: `YOUR_BUNDLE_ID://${account.namespace}/macos/YOUR_BUNDLE_ID/callback` -::: +```text +https://${account.namespace}/macos/YOUR_BUNDLE_IDENTIFIER/callback, +YOUR_BUNDLE_IDENTIFIER://${account.namespace}/macos/YOUR_BUNDLE_IDENTIFIER/callback +``` + +For example, if your iOS bundle identifier were `com.example.MyApp` and your Auth0 domain were `example.us.auth0.com`, then this value would be: -Lastly, be sure that the **Application Type** for your application is set to **Native** in the [Application Settings](${manage_url}/#/applications/${account.clientId}/settings). +```text +https://example.us.auth0.com/ios/com.example.MyApp/callback, +com.example.MyApp://example.us.auth0.com/ios/com.example.MyApp/callback +``` diff --git a/articles/quickstart/native/flutter/files/main.md b/articles/quickstart/native/flutter/files/main.md index 0be4b89d92..b0f41fd59a 100644 --- a/articles/quickstart/native/flutter/files/main.md +++ b/articles/quickstart/native/flutter/files/main.md @@ -34,8 +34,10 @@ class _MainViewState extends State { if (_credentials == null) ElevatedButton( onPressed: () async { + // Use a Universal Link callback URL on iOS 17.4+ / macOS 14.4+ + // useHTTPS is ignored on Android final credentials = - await auth0.webAuthentication().login(); + await auth0.webAuthentication().login(useHTTPS: true); setState(() { _credentials = credentials; @@ -48,7 +50,9 @@ class _MainViewState extends State { ProfileView(user: _credentials!.user), ElevatedButton( onPressed: () async { - await auth0.webAuthentication().logout(); + // Use a Universal Link logout URL on iOS 17.4+ / macOS 14.4+ + // useHTTPS is ignored on Android + await auth0.webAuthentication().logout(useHTTPS: true); setState(() { _credentials = null; diff --git a/articles/quickstart/native/flutter/interactive.md b/articles/quickstart/native/flutter/interactive.md index 84641bab10..8735a35d88 100644 --- a/articles/quickstart/native/flutter/interactive.md +++ b/articles/quickstart/native/flutter/interactive.md @@ -27,7 +27,7 @@ github: Auth0 allows you to quickly add authentication and access user profile information in your app. This guide demonstrates how to integrate Auth0 with a Flutter app using the [Auth0 Flutter SDK](https://github.com/auth0/auth0-flutter). :::note -The Flutter SDK currently only supports Flutter apps running on Android, iOS, and macOS platforms. +The Flutter SDK currently only supports Flutter apps for Android, iOS, and macOS. ::: This quickstart assumes you already have a [Flutter](https://flutter.dev/) app up and running. If not, check out the [Flutter "getting started" guides](https://docs.flutter.dev/get-started/install) to get started with a simple app. @@ -63,15 +63,39 @@ Run **Sync Project with Gradle Files** inside Android Studio to apply your chang ## Configure iOS/macOS -If you are not developing for the iOS or macOS platform, skip this step. +If you are not developing for the iOS or macOS platforms, skip this step. -You need to register your bundle identifier as a custom URL scheme so the callback and logout URLs can reach your app. +::: warning +This step requires a paid Apple Developer account. It is needed to use Universal Links as callback and logout URLs. Skip this step to use a custom URL scheme instead. +::: + +### Configure the Team ID and bundle identifier + +Go to the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application, scroll to the end, and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to your app's bundle identifier. + +

Screenshot of the iOS section inside the Auth0 application settings page

+ +This will add your app to your Auth0 tenant's `apple-app-site-association` file. + +### Add the associated domain capability -In Xcode, go to the **Info** tab of your app target settings. In the **URL Types** section, select the **+** button to add a new entry. Then enter `auth0` into the **Identifier** field and `$(PRODUCT_BUNDLE_IDENTIFIER)` into the **URL Schemes** field. +Open your app in Xcode by running `open ios/Runner.xcworkspace` (or `open macos/Runner.xcworkspace` for macOS). Go to the **Signing and Capabilities** [tab](https://developer.apple.com/documentation/xcode/adding-capabilities-to-your-app#Add-a-capability) of the **Runner** target settings, and press the **+ Capability** button. Then select **Associated Domains**. -

Custom URL Scheme

+

Screenshot of the capabilities library inside Xcode

+ +Next, add the following [entry](https://developer.apple.com/documentation/xcode/configuring-an-associated-domain#Define-a-service-and-its-associated-domain) under **Associated Domains**: + +```text +webcredentials:${account.namespace} +``` + +If you have a [custom domain](/customize/custom-domains), use this instead of the Auth0 domain from the settings page. + +::: note +For the associated domain to work, your app must be signed with your team certificate **even when building for the iOS simulator**. Make sure you are using the Apple Team whose Team ID is configured in the settings page of your Auth0 application. +::: -## Add login to your application {{{ data-action="code" data-code="main_view.dart#29:38" }}} +## Add login to your application {{{ data-action="code" data-code="main_view.dart#29:40" }}} [Universal Login](https://auth0.com/docs/authenticate/login/auth0-universal-login) is the easiest way to set up authentication in your app. We recommend using it for the best experience, best security, and the fullest array of features. @@ -104,7 +128,7 @@ Still having issues? Check out our [documentation](https://auth0.com/docs) or vi ::: :::: -## Add logout to your application {{{ data-action=code data-code="main_view.dart#43:51"}}} +## Add logout to your application {{{ data-action=code data-code="main_view.dart#45:55"}}} To log users out, redirect them to the Auth0 logout endpoint to clear their login session by calling the Auth0 Flutter SDK `webAuthentication().logout()`. [Read more about logging out of Auth0](https://auth0.com/docs/authenticate/login/logout). diff --git a/articles/quickstart/native/ios-swift/01-login.md b/articles/quickstart/native/ios-swift/01-login.md index 3bb225c88c..50e4cce9cd 100755 --- a/articles/quickstart/native/ios-swift/01-login.md +++ b/articles/quickstart/native/ios-swift/01-login.md @@ -19,6 +19,8 @@ useCase: quickstart ## Configure Auth0 +You will need a **Native** Auth0 application. If you don’t have a Native Auth0 application already, [create one](/get-started/auth0-overview/create-applications/native-apps) before continuing. Avoid using other application types, as they have different configurations and may cause errors. + ### Configure the callback and logout URLs The callback and logout URLs are the URLs that Auth0 invokes to redirect back to your app. Auth0 invokes the callback URL after authenticating the user, and the logout URL after removing the session cookie. @@ -31,11 +33,7 @@ On iOS 17.4+ and macOS 14.4+ it is possible to use Universal Links as callback a **This feature requires Xcode 15.3+ and a paid Apple Developer account**. ::: -Go to the settings page of your [Auth0 application](${manage_url}/#/applications/${account.clientId}/settings) and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, according to the platform of your app. If you have a [custom domain](/customize/custom-domains), use this instead of the Auth0 domain from the settings page. - -::: warning -Make sure that the [application type](/get-started/applications) of the Auth0 application is **Native**. If you don’t have a Native Auth0 application already, [create one](/get-started/auth0-overview/create-applications/native-apps) before continuing. -::: +Go to the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, according to the platform of your app. If you have a [custom domain](/customize/custom-domains), use this instead of the Auth0 domain from the settings page. #### iOS diff --git a/articles/quickstart/native/ios-swift/download.md b/articles/quickstart/native/ios-swift/download.md index 72e7243cf6..da473506e5 100644 --- a/articles/quickstart/native/ios-swift/download.md +++ b/articles/quickstart/native/ios-swift/download.md @@ -13,7 +13,7 @@ Go to the **Signing and Capabilities** tab of the app's target settings. Find th ## 3. Configure the Auth0 application -Open the settings page of your [Auth0 application](${manage_url}/#/applications/${account.clientId}/settings) and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**. If you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain instead of the value from the settings page. +Open the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**. If you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain instead of the value from the settings page. For **SwiftSample (iOS)**: diff --git a/articles/quickstart/native/ios-swift/interactive.md b/articles/quickstart/native/ios-swift/interactive.md index 0f556341e0..0b6d9ae08d 100644 --- a/articles/quickstart/native/ios-swift/interactive.md +++ b/articles/quickstart/native/ios-swift/interactive.md @@ -82,7 +82,7 @@ This step requires a paid Apple Developer account. It is needed to use Universal #### Configure the Team ID and bundle identifier -Go to the settings page of your [Auth0 application](${manage_url}/#/applications/${account.clientId}/settings), scroll to the end, and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to your app's bundle identifier. +Go to the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application, scroll to the end, and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to your app's bundle identifier.

Screenshot of the iOS section inside the Auth0 application settings page

From 914f6826888e68f54d9a024d78c0b574846ec037 Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Thu, 14 Mar 2024 22:05:26 +0000 Subject: [PATCH 2/6] Update the `download.md` instructions --- .../quickstart/native/flutter/download.md | 40 ++++++++----------- .../quickstart/native/ios-swift/download.md | 30 +++++--------- 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/articles/quickstart/native/flutter/download.md b/articles/quickstart/native/flutter/download.md index 21e0e2f1da..90665b863f 100644 --- a/articles/quickstart/native/flutter/download.md +++ b/articles/quickstart/native/flutter/download.md @@ -1,31 +1,25 @@ -To run the sample follow these steps: + -1) Set the **Allowed Callback URLs** and **Allowed Logout URLs** in the [Application Settings](${manage_url}/#/applications/${account.clientId}/settings) to the following value so it works for Android, iOS, and macOS apps: +> On all steps, if you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain instead of the value from the settings page. -```text -com.auth0.samples.FlutterSample://${account.namespace}/ios/com.auth0.samples.FlutterSample/callback,com.auth0.sample://${account.namespace}/android/com.auth0.sample/callback,com.auth0.sample://${account.namespace}/macos/com.auth0.sample/callback -``` +## 1. Configure the Auth0 application -2) Rename the file `.env.example` to `.env` and fill in the following values: +Open the settings page of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the platform. -```sh -AUTH0_DOMAIN=${account.namespace} -AUTH0_CLIENT_ID=${account.clientId} -AUTH0_CUSTOM_SCHEME=com.auth0.sample -``` +- Android: `com.auth0.sample://YOUR_AUTH0_DOMAIN/android/com.auth0.sample/callback` +- iOS: `https://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback` +- macOS: `https://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback` -3) Rename the file `strings.xml.example` in `android/app/src/main/res/values` to `strings.xml` and fill in the following values: +## 2. Configure the associated domain (iOS/macOS only) -```xml - - - ${account.namespace} - com.auth0.sample - -``` +> **This following requires Xcode 15.3+ and a paid Apple Developer account**. If you do not have a paid Apple Developer account, skip this step, and set the `useHTTPS` parameter to `false` in the `login()` and `logout()` calls at `lib/example_app.dart`. -4) Use the [Flutter CLI's](https://docs.flutter.dev/reference/flutter-cli) `run` command to run the app: +Open `ios/Runner.xcodeproj` (or `macos/Runner.xcodeproj`, for macOS) in Xcode and go to the settings of the **Runner** app target. In the **Signing & Capabilities** tab, change the bundle identifier from the default `com.auth0.samples.FlutterSample` to another value of your choosing. Then, make sure the **Automatically manage signing** box is checked, and that your Apple Team is selected. -```sh -flutter run -``` +Next, find the `webcredentials:YOUR_AUTH0_DOMAIN` entry under **Associated Domains**, and replace the `YOUR_AUTH0_DOMAIN` placeholder with the domain of your Auth0 application. + +Finally, open the settings page of your Auth0 application, scroll to the end, and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to the app's bundle identifier. + +## 3. Run the app + +Use the [Flutter CLI](https://docs.flutter.dev/reference/flutter-cli) to run the app: `flutter run`. diff --git a/articles/quickstart/native/ios-swift/download.md b/articles/quickstart/native/ios-swift/download.md index da473506e5..82ca63019a 100644 --- a/articles/quickstart/native/ios-swift/download.md +++ b/articles/quickstart/native/ios-swift/download.md @@ -1,32 +1,20 @@ -## 1. Configure code signing +> On all steps, if you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain instead of the value from the settings page. -To run the sample application, first open `SwiftSample.xcodeproj` in Xcode and go to the settings of the application target you want to run. There are two application targets available: **SwiftSample (iOS)** and **SwiftSample (macOS)**. Change the bundle identifier from the default `com.auth0.samples.SwiftSample` to another value of your choosing. -Then, make sure the **Automatically manage signing** box is checked, and that your Apple Team is selected. - -## 2. Configure the associated domain +## 1. Configure the associated domain > **This requires Xcode 15.3+ and a paid Apple Developer account**. If you do not have a paid Apple Developer account, skip this step, and comment out the two `useHTTPS()` calls in `MainView.swift`. -Go to the **Signing and Capabilities** tab of the app's target settings. Find the `webcredentials:{YOUR_AUTH0_DOMAIN}` entry under **Associated Domains**, and replace the placeholder `{YOUR_AUTH0_DOMAIN}` value with the domain of your Auth0 application. If have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `{YOUR_AUTH0_DOMAIN}` with your custom domain instead of the value from the settings page. - -## 3. Configure the Auth0 application - -Open the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**. If you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain instead of the value from the settings page. +Open `SwiftSample.xcodeproj` in Xcode and go to the settings of the application target you want to run. There are two application targets available: **SwiftSample (iOS)** and **SwiftSample (macOS)**. Change the bundle identifier from the default `com.auth0.samples.SwiftSample` to another value of your choosing. Then, make sure the **Automatically manage signing** box is checked, and that your Apple Team is selected. -For **SwiftSample (iOS)**: +Next, go to the **Signing and Capabilities** tab of the app's target settings. Find the `webcredentials:YOUR_AUTH0_DOMAIN` entry under **Associated Domains**, and replace the `YOUR_AUTH0_DOMAIN` placeholder with the domain of your Auth0 application. -```text -https://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback, -YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback -``` +Finally, open the settings page of your Auth0 application, scroll to the end, and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to the app's bundle identifier. -For **SwiftSample (macOS)**: +## 2. Configure the Auth0 application -```text -https://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback, -YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback -``` +Open the settings page of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**. -Then, scroll to the end of the settings page and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to the app's bundle identifier. +- **SwiftSample (iOS)**: `https://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback` +- **SwiftSample (macOS)**: `https://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback` From 1e4ea70b6fbd1b658e5188aa1e93fa5d71247894 Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Thu, 14 Mar 2024 22:08:27 +0000 Subject: [PATCH 3/6] Update reference to Xcode UI --- articles/quickstart/native/ios-swift/download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/quickstart/native/ios-swift/download.md b/articles/quickstart/native/ios-swift/download.md index 82ca63019a..7ac6e2a047 100644 --- a/articles/quickstart/native/ios-swift/download.md +++ b/articles/quickstart/native/ios-swift/download.md @@ -8,7 +8,7 @@ Open `SwiftSample.xcodeproj` in Xcode and go to the settings of the application target you want to run. There are two application targets available: **SwiftSample (iOS)** and **SwiftSample (macOS)**. Change the bundle identifier from the default `com.auth0.samples.SwiftSample` to another value of your choosing. Then, make sure the **Automatically manage signing** box is checked, and that your Apple Team is selected. -Next, go to the **Signing and Capabilities** tab of the app's target settings. Find the `webcredentials:YOUR_AUTH0_DOMAIN` entry under **Associated Domains**, and replace the `YOUR_AUTH0_DOMAIN` placeholder with the domain of your Auth0 application. +Next, go to the **Signing & Capabilities** tab of the app's target settings. Find the `webcredentials:YOUR_AUTH0_DOMAIN` entry under **Associated Domains**, and replace the `YOUR_AUTH0_DOMAIN` placeholder with the domain of your Auth0 application. Finally, open the settings page of your Auth0 application, scroll to the end, and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to the app's bundle identifier. From cd6ea60314e6e14402476e8e175ac865b0a62a9f Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Thu, 14 Mar 2024 22:22:52 +0000 Subject: [PATCH 4/6] Rework a few sentences --- .../native/flutter/_configure_urls_interactive.md | 6 ++---- articles/quickstart/native/flutter/download.md | 2 +- articles/quickstart/native/ios-swift/01-login.md | 2 +- articles/quickstart/native/ios-swift/download.md | 4 ++-- articles/quickstart/native/ios-swift/interactive.md | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/articles/quickstart/native/flutter/_configure_urls_interactive.md b/articles/quickstart/native/flutter/_configure_urls_interactive.md index 8edfa83243..e1a0c2f280 100644 --- a/articles/quickstart/native/flutter/_configure_urls_interactive.md +++ b/articles/quickstart/native/flutter/_configure_urls_interactive.md @@ -12,11 +12,9 @@ If you would rather explore a complete configuration, you can view a sample app ### Configure the callback and logout URLs -The callback and logout URLs are the URLs that Auth0 invokes to redirect back to your app. Auth0 invokes the callback URL after authenticating the user, and the logout URL after removing the session cookie. +The callback and logout URLs are the URLs that Auth0 invokes to redirect back to your app. Auth0 invokes the callback URL after authenticating the user, and the logout URL after removing the session cookie. If the callback and logout URLs are not set, users will be unable to log in and out of the app and will get an error. -If the callback and logout URLs are not set, users will be unable to log in and out of the app and will get an error. - -Set the callback and logout URLs to the following value, depending on your platform. +Set the callback and logout URLs to the following values, depending on your platform. ::: note On Android, the value of the `SCHEME` placeholder can be `https` or some other custom scheme. `https` schemes require enabling [Android App Links](https://auth0.com/docs/get-started/applications/enable-android-app-links-support). diff --git a/articles/quickstart/native/flutter/download.md b/articles/quickstart/native/flutter/download.md index 90665b863f..d0455825df 100644 --- a/articles/quickstart/native/flutter/download.md +++ b/articles/quickstart/native/flutter/download.md @@ -4,7 +4,7 @@ ## 1. Configure the Auth0 application -Open the settings page of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the platform. +Open the settings page of your Auth0 application and add the following URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the platform. - Android: `com.auth0.sample://YOUR_AUTH0_DOMAIN/android/com.auth0.sample/callback` - iOS: `https://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback` diff --git a/articles/quickstart/native/ios-swift/01-login.md b/articles/quickstart/native/ios-swift/01-login.md index 50e4cce9cd..24cdf22165 100755 --- a/articles/quickstart/native/ios-swift/01-login.md +++ b/articles/quickstart/native/ios-swift/01-login.md @@ -33,7 +33,7 @@ On iOS 17.4+ and macOS 14.4+ it is possible to use Universal Links as callback a **This feature requires Xcode 15.3+ and a paid Apple Developer account**. ::: -Go to the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, according to the platform of your app. If you have a [custom domain](/customize/custom-domains), use this instead of the Auth0 domain from the settings page. +Go to the [settings page](${manage_url}/#/applications/${account.clientId}/settings) of your Auth0 application and add the following URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the platform of your app. If you have a [custom domain](/customize/custom-domains), use this instead of the value from the settings page. #### iOS diff --git a/articles/quickstart/native/ios-swift/download.md b/articles/quickstart/native/ios-swift/download.md index 7ac6e2a047..24bd8fa940 100644 --- a/articles/quickstart/native/ios-swift/download.md +++ b/articles/quickstart/native/ios-swift/download.md @@ -6,7 +6,7 @@ > **This requires Xcode 15.3+ and a paid Apple Developer account**. If you do not have a paid Apple Developer account, skip this step, and comment out the two `useHTTPS()` calls in `MainView.swift`. -Open `SwiftSample.xcodeproj` in Xcode and go to the settings of the application target you want to run. There are two application targets available: **SwiftSample (iOS)** and **SwiftSample (macOS)**. Change the bundle identifier from the default `com.auth0.samples.SwiftSample` to another value of your choosing. Then, make sure the **Automatically manage signing** box is checked, and that your Apple Team is selected. +Open `SwiftSample.xcodeproj` in Xcode and go to the settings of the app target you want to run. There are two app targets available: **SwiftSample (iOS)** and **SwiftSample (macOS)**. Change the bundle identifier from the default `com.auth0.samples.SwiftSample` to another value of your choosing. Then, make sure the **Automatically manage signing** box is checked, and that your Apple Team is selected. Next, go to the **Signing & Capabilities** tab of the app's target settings. Find the `webcredentials:YOUR_AUTH0_DOMAIN` entry under **Associated Domains**, and replace the `YOUR_AUTH0_DOMAIN` placeholder with the domain of your Auth0 application. @@ -14,7 +14,7 @@ Finally, open the settings page of your Auth0 application, scroll to the end, an ## 2. Configure the Auth0 application -Open the settings page of your Auth0 application and add the corresponding URLs to **Allowed Callback URLs** and **Allowed Logout URLs**. +Open the settings page of your Auth0 application and add the following URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the app target you want to run. - **SwiftSample (iOS)**: `https://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback` - **SwiftSample (macOS)**: `https://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback` diff --git a/articles/quickstart/native/ios-swift/interactive.md b/articles/quickstart/native/ios-swift/interactive.md index 0b6d9ae08d..10babccc90 100644 --- a/articles/quickstart/native/ios-swift/interactive.md +++ b/articles/quickstart/native/ios-swift/interactive.md @@ -51,7 +51,7 @@ On iOS 17.4+ and macOS 14.4+ it is possible to use Universal Links as callback a **This feature requires Xcode 15.3+ and a paid Apple Developer account**. ::: -Add the corresponding URLs to **Callback URLs** and **Logout URLs**, according to the platform of your app. If you have a [custom domain](/customize/custom-domains), use this instead of your Auth0 tenant’s domain. +Add the following URLs to **Callback URLs** and **Logout URLs**, depending on the platform of your app. If you have a [custom domain](/customize/custom-domains), use this instead of your Auth0 tenant’s domain. #### iOS From 846842bbd91720bc66645f34182954aefda519ae Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Thu, 14 Mar 2024 22:25:45 +0000 Subject: [PATCH 5/6] Reword sentence in `download.md` --- articles/quickstart/native/flutter/download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/quickstart/native/flutter/download.md b/articles/quickstart/native/flutter/download.md index d0455825df..67d2297389 100644 --- a/articles/quickstart/native/flutter/download.md +++ b/articles/quickstart/native/flutter/download.md @@ -4,7 +4,7 @@ ## 1. Configure the Auth0 application -Open the settings page of your Auth0 application and add the following URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the platform. +Open the settings page of your Auth0 application and add the following URLs to **Allowed Callback URLs** and **Allowed Logout URLs**, depending on the platform you want to use. - Android: `com.auth0.sample://YOUR_AUTH0_DOMAIN/android/com.auth0.sample/callback` - iOS: `https://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback,YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback` From c9c72841548214bd8c3dfd12323c44d7c35c7a12 Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Thu, 14 Mar 2024 22:37:37 +0000 Subject: [PATCH 6/6] Rephrase custom domain callout --- articles/quickstart/native/flutter/download.md | 2 +- articles/quickstart/native/ios-swift/download.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/articles/quickstart/native/flutter/download.md b/articles/quickstart/native/flutter/download.md index 67d2297389..8973142196 100644 --- a/articles/quickstart/native/flutter/download.md +++ b/articles/quickstart/native/flutter/download.md @@ -1,6 +1,6 @@ -> On all steps, if you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain instead of the value from the settings page. +> On every step, if you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace the `YOUR_AUTH0_DOMAIN` placeholder with your custom domain instead of the value from the settings page. ## 1. Configure the Auth0 application diff --git a/articles/quickstart/native/ios-swift/download.md b/articles/quickstart/native/ios-swift/download.md index 24bd8fa940..4e7e9e3db7 100644 --- a/articles/quickstart/native/ios-swift/download.md +++ b/articles/quickstart/native/ios-swift/download.md @@ -1,6 +1,6 @@ -> On all steps, if you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain instead of the value from the settings page. +> On every step, if you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace the `YOUR_AUTH0_DOMAIN` placeholder with your custom domain instead of the value from the settings page. ## 1. Configure the associated domain