📚 Documentation • 🚀 Getting Started • 💻 Sample App • 📃 Support Policy • 💬 Feedback
Composable UI building blocks for MFA enrollment and verification on iOS, built with SwiftUI Compose. This library provides ready-to-use components that integrate seamlessly with Auth0's authentication flows.
This library provides ready-to-use UI components for multi-factor authentication:
- 🔐 TOTP (Time-based One-Time Password) - Authenticator app support with QR code enrollment
- 📱 Push Notifications - Secure push-based authentication
- 💬 SMS OTP - Phone number verification via one-time codes
- 📧 Email OTP - Email-based verification
- 🔑 Recovery Codes - Backup authentication codes for account recovery
All components are built on top of the Auth0 Swift SDK and integrate with Auth0's My Account APIs.
⚠️ BETA RELEASE - This SDK is currently in beta. APIs may change before the stable release.
- iOS 16.0+
- macOS 14.0+
- visionOS 1.0+
- Swift 6.0+
- Xcode 26.0+
Add the following to your Podfile:
pod 'Auth0UIComponents'Then run pod install.
Add the following to your Package.swift:
.package(url: "https://github.com/auth0/ui-components-ios.git", from: "1.0.0")Or use Xcode: File → Add Packages → Enter the repository URL.
Add the following to your Cartfile:
github "auth0/ui-components-ios"
You can configure the SDK in two ways:
- Create
Auth0.plistin your Xcode project:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Domain</key>
<string>YOUR_AUTH0_DOMAIN.auth0.com</string>
<key>ClientId</key>
<string>YOUR_AUTH0_CLIENT_ID</string>
<key>Audience</key>
<string>https://YOUR_AUTH0_DOMAIN.auth0.com/api/v2/</string>
</dict>
</plist>- Ensure
Auth0.plistis added to your target's Build Phases.
Pass your credentials directly during initialization.
Initialize Auth0Dependencies in your app's entry point. This must be done before using any UI components.
import SwiftUI
import Auth0UIComponents
// Custom token provider
struct YourTokenProvider: TokenProvider {
func fetchAPICredentials(audience: String, scope: String) async throws -> APICredentials {
// Your custom logic to retrieve access token
}
}
@main
struct MyApp: App {
init() {
// Initialize with Auth0.plist
Auth0UIComponentsSDKInitializer.initialize(tokenProvider: YourTokenProvider())
// OR initialize programmatically
//Auth0UIComponentsSDKInitializer.initialize(session: URLSession = .shared,
// bundle: Bundle = .main,
// domain: "your-auth0-domain",
// clientId: "your_client_id",
// audience: "https://your-auth0-domain.auth0.com/me/",
// tokenProvider: YourTokenProvider())
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}Once initialized, you can use any of the provided UI components in your views:
import SwiftUI
import Auth0UIComponents
struct ContentView: View {
var body: some View {
NavigationView {
List {
NavigationLink(destination: MyAccountAuthMethodsView()) {
Text("Authentication Methods")
}
}
.navigationTitle("Account Settings")
}
}
}This SDK uses Universal Login for step-up authentication flows. When an MFA-required error is encountered, the SDK automatically initiates a step-up flow to allow users to complete the required MFA challenge.
To enable the step-up flow, configure the following in your Auth0 Tenant:
- Associated Domains - Add your app's associated domain to your Auth0 application settings
- Callback URLs - Configure the following in your Auth0 application:
- Add your app's callback URL (e.g.,
com.yourcompany.yourapp://YOUR_AUTH0_DOMAIN/ios/com.yourcompany.yourapp/callback) - Ensure it matches your app's URL scheme and associated domain configuration
- Add your app's callback URL (e.g.,
- In your Xcode project, enable Associated Domains capability
- Add your domain entitlement (e.g.,
applinks:YOUR_AUTH0_DOMAIN.auth0.com) - Configure your Auth0 application settings with the callback URL
- The SDK will automatically handle the Universal Login flow when MFA is required
For more detailed information on Universal Login configuration, associated domains, and callback URL setup, refer to the Auth0.swift SDK documentation.
Display and manage user's authentication methods.
MyAccountAuthMethodsView()Allows users to:
- View connected authenticators
- Enroll in new authentication methods (TOTP, Push, Email, SMS, Recovery Code)
- Remove authentication methods
| Authentication Methods | Manage Auth Methods |
|---|---|
![]() |
![]() |
| View connected authenticators | Delete/Add MFA |
This repository includes a sample app (AppUIComponents target) that demonstrates how to use the Auth0 UI Components SDK. You can use the sample app to explore the SDK's features and test the MFA components.
-
Clone the repository:
git clone https://github.com/auth0/ui-components-ios.git cd ui-components-ios -
Install dependencies using Carthage:
carthage bootstrap --use-xcframeworks
-
Configure Auth0 credentials:
- Open
AppUIComponents/Auth0.plist - Update with your Auth0 tenant information:
<dict> <key>Domain</key> <string>YOUR_AUTH0_DOMAIN.auth0.com</string> <key>ClientId</key> <string>YOUR_AUTH0_CLIENT_ID</string> <key>Audience</key> <string>https://YOUR_AUTH0_DOMAIN.auth0.com/api/v2/</string> </dict>
- Open
-
Open the project in Xcode:
open Auth0UIComponents.xcodeproj
-
Select the
AppUIComponentstarget from the scheme dropdown -
Build and run the app on a simulator or physical device (Xcode 26.0+)
This Policy defines the extent of the support for Xcode, Swift, and platform (iOS, macOS, tvOS, and watchOS) versions in Auth0.swift.
The only supported versions of Xcode are those that can be currently used to submit apps to the App Store. Once a Xcode version becomes unsupported, dropping it from Auth0.swift will not be considered a breaking change, and will be done in a minor release.
The minimum supported Swift minor version is the one released with the oldest-supported Xcode version. Once a Swift minor becomes unsupported, dropping it from Auth0.swift will not be considered a breaking change, and will be done in a minor release.
We support only the last four major versions of any platform, including the current major version.
Once a platform version becomes unsupported, dropping it from ui-components-ios will not be considered a breaking change, and will be done in a minor release. For example, iOS 14 will cease to be supported when iOS 18 gets released, and ui-components-ios will be able to drop it in a minor release.
In the case of macOS, the yearly named releases are considered a major platform version for the purposes of this Policy, regardless of the actual version numbers.
We appreciate feedback and contribution to this repo! Before you get started, please see the following:
- Auth0's general contribution guidelines
- Auth0's code of conduct guidelines
- ui-components-ios's contribution guide
To provide feedback or report a bug, please raise an issue on our issue tracker.
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Auth0 is an easy-to-implement, adaptable authentication and authorization platform. To learn more check out Why Auth0?
This project is licensed under the Apache License 2.0. See the LICENSE file for more info.
Copyright 2025 Okta, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


