Universal Components allows you to build a self service account security UI within your native iOS and Android applications. This enables your users to manage their own authentication methods, such as MFA factors, passkeys, and recovery codes directly inside your application, without leaving for a web browser or contacting support.Documentation Index
Fetch the complete documentation index at: https://auth0-feat-docs-5492.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Universal Components leverage the My Account API, which operates using user scoped tokens, to render an authentication-methods management UI inside your application. When an authenticated user opens their account settings screen, The Auth0 SDK, Auth0.swift on iOS and Auth0.Android on Android, retrieves an Access Token scoped to the My Account API audience. Universal Components use this token to call the API as the logged in user, ensuring each user can only modify their own authentication methods.My Account components are used to create end-user self-service interfaces.
For delegated admin UI where a user manages an Auth0 Organization, read Build a Delegated Admin Interface.
Available components
Each component leverages the My Account API and covers one or more authentication methods.| Component | API endpoint |
|---|---|
Auth Methods Management — MyAccountAuthMethodsView (iOS) / AuthenticatorSettingsComponent (Android). Enrolls, lists, and removes every authentication method on the user’s account: Email OTP, SMS OTP, TOTP (Authenticator app), Push via Auth0 Guardian, Passkeys, and Recovery Codes. | /me/v1/authentication-methods |
Configure My Account Components using the Auth0 Dashboard
To use My Account components, you need to configure your Auth0 tenant with the proper APIs, applications, and scopes.Enable the My Account API
- Navigate to Dashboard > Applications > APIs.
- Select Activate My Account API to and ensure it is enabled for your tenant.
Create an Application and configure My Account API scopes
- Navigate to Dashboard > Applications.
- Select Create Application.
- Select Native.
- In the Settings tab, add the callback URL in the Allowed Callback URLs:
- For iOS applications use:
https://YOUR_AUTH0_DOMAIN://YOUR_BUNDLE_ID/ios/YOUR_BUNDLE_ID/callback. - For Android applications use:
https://YOUR_AUTH0_DOMAIN://YOUR_PACKAGE_NAME/android/YOUR_PACKAGE_NAME/callback.
- For iOS applications use:
- Add your logout URLs in the Allowed Logout URLs.
- Select the API Access Tab.
- Select Edit for the Auth0 My Account API to select the User delegated Access permissions:
Configure scopes
Request the scopes your app needs from the My Account API when obtaining the user’s access token.Required scopes
Required scopes
The user’s token only includes permissions they were granted during login. Request all four scopes if you want users to enroll, review, and remove authentication methods.
Configure passkeys (optional)
You can skip this step if you are not enabling passkey enrollment.- Navigate to Dashboard > Authentication > Database. Open the database connection you want passkeys enabled on.
- Under Passkey settings, toggle Require Passkey Enrollment as needed for your policy.
-
Register your mobile applications so the platform authenticator can issue credentials for your Auth0 tenant:
- For iOS applications add: your application’s bundle ID under Allowed iOS Applications.
- For Android applications add: your applications’s package name and SHA-256 signing fingerprints under Allowed Android Applications. Obtain the fingerprint with
keytool -list -v -keystore /path/to/keystore -alias YOUR_ALIAS | grep SHA256, or copy it from Play Console > Setup > App signing for Play App Signing.
Passkeys require custom domains to be enabled in your tenant.
Configure your application
- iOS
- Android
Install the SDK
To install theAuth0UniversalComponents use the Swift Package Manager, CocoaPods, or Carthage. For installation details and requirements, read Auth0 Universal Components for Native Apps.Initialize the SDK
To initialize the SDK call theAuth0UniversalComponentsSDKInitializer.initialize(...) once at application start, typically in your application struct’s init. If your application already uses Auth0.plist to configure Auth0.swift, add ClientId, Domain, and Audience keys and call:App.swift
App.swift
Configure the token provider
TheTokenProvider protocol is how the SDK asks your application for credentials.
Auth0 recommends to use the Auth0.swift's CredentialsManager for production integrations and avoid hand-rolling a custom implementation unless you have storage requirements that Auth0.swift doesn’t meet.Custom TokenProvider
Custom TokenProvider
If you manage credentials yourself, implement all four methods:
Configure passkeys (optional)
To configure passkeys implement aPasskeysConfiguration to override default passkey behavior. All fields are optional.Passkeys require iOS 16.6+, macOS 13.5+, or visionOS 1.0+.
Users must be authenticated before you render any component. Once the SDK is initialized and your
TokenProvider is wired up, drop the Auth Methods Management component into your settings screen to give users full MFA, passkey, and recovery-code self-service.