Skip to content

feat: Upgrade Auth0.swift to v3.0.2 - #909

Draft
NandanPrabhu wants to merge 3 commits into
develop/v3.0from
feat/auth0-swift-v3.0
Draft

feat: Upgrade Auth0.swift to v3.0.2#909
NandanPrabhu wants to merge 3 commits into
develop/v3.0from
feat/auth0-swift-v3.0

Conversation

@NandanPrabhu

@NandanPrabhu NandanPrabhu commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Upgraded Auth0.swift dependency from v2.x to v3.0.1 for iOS, macOS, tvOS, and watchOS
  • Updated all Darwin plugin method handlers to handle Auth0 v3 API changes
  • Updated test suite to match new Auth0.swift v3.0.1 signatures
  • Removed deprecated APIs and adapted to new error handling patterns

Key Changes

Dependency Updates

  • Updated podspec files to use Auth0.swift 3.0.2
  • Updated Swift Package Manager dependencies

API Migration

  • Error Handling: Migrated from .webAuthError() to .authenticationError() for WebAuth errors
  • Credentials Manager: Updated credential manager API calls for v3 signatures
  • Auth API: Adapted authentication API method handlers for new response types
  • MFA API: Updated multifactor authentication handlers
  • Passkey Support: Updated passkey credential exchange methods

Test Suite Updates

  • Updated test mocks and spies to match Auth0.swift v3.0.1 signatures
  • Fixed error handling assertions in test cases
  • Updated method signatures across all test files

Test Plan

  • All existing unit tests pass
  • iOS example app runs successfully
  • Login/logout flow works
  • Credentials manager operations work
  • MFA flows work correctly
  • Passkey authentication works

Bumps the native iOS/macOS SDK dependency from 2.23.0 to 3.0.1 across
the podspecs, Package.swift, and Package.resolved lockfiles, and
updates every native call site for the v3 breaking changes: the
Authentication -> MFAClient split for OTP login/MFA challenge,
WebAuth.clearSession -> logout, CredentialsManager.store/clear
becoming throwing calls, CredentialsManager.user -> userProfile(),
UserInfo -> UserProfile, and Credentials.expiresIn -> expiresAt.

Also updates the Dart-facing multifactorChallenge API: authenticatorId
is now required and the types parameter is removed, since Auth0.swift
v3's MFAClient.challenge(with:mfaToken:) has no equivalent for
challenge-type filtering.
…test suite

Fixes a remaining compile error in WebAuthLoginMethodHandler.swift:
Auth0.swift v3 made WebAuthentication.safariProvider @MainActor-isolated,
which broke the default-argument closure and its call site. Also adds
UIScene support (SceneDelegate.swift + Info.plist manifest) and bumps
the example app's CocoaPods deployment target to 15.0, both needed to
actually launch the example app on current Xcode/iOS Simulator versions.

Migrates the darwin plugin's XCTest suite (previously untouched by the
v3 dependency bump) to the new SDK shape: Telemetry -> Auth0ClientInfo,
UserInfo -> UserProfile, expiresIn -> expiresAt, throwing
CredentialsStorage, Request<T,E> -> any Requestable/TokenRequestable
(via new MockRequest/MockTokenRequest test doubles), the Authentication
-> MFAClient split for OTP login and MFA challenge, and the new
WebAuthError cases. All 358 RunnerTests unit tests pass.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: be35d702-bfb9-4da0-98c6-fa53c61abf7f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/auth0-swift-v3.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The macOS test target was missing 8 MFA-related test files that are
referenced by other test files. This caused compilation errors in
GitHub Actions when building macOS tests, specifically:
- SpyMFAClient not found (defined in MfaSpies.swift)
- Other MFA test infrastructure missing

Added the following test files to the macOS RunnerTests target:
- MfaSpies.swift
- MfaGetAuthenticatorsMethodHandlerTests.swift
- MfaEnrollTotpMethodHandlerTests.swift
- MfaEnrollPhoneMethodHandlerTests.swift
- MfaEnrollEmailMethodHandlerTests.swift
- MfaEnrollPushMethodHandlerTests.swift
- MfaChallengeMethodHandlerTests.swift
- MfaVerifyMethodHandlerTests.swift

These files already existed in the iOS test target and are shared
via relative path (../ios/Tests/Mfa/).
@NandanPrabhu NandanPrabhu changed the title feat: Upgrade Auth0.swift to v3.0.1 feat: Upgrade Auth0.swift to v3.0.2 Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant