This repository documents a workaround for Auth0.swift issue #950.
A fix for GH issue 950 has been implemented and merged. See PR #1008 for the complete solution.
- Fixed by @NandanPrabhu
- Originally posted in PR #1010
The fix addresses authentication issues in Auth0.swift. For implementation details and code changes, please refer to the upstream pull request.
- macOS 10.15 (Catalina) or later
- Xcode 12.0 or later
- Swift 5.3 or later
- Open your project in Xcode
- Navigate to File > Add Packages...
- Enter the repository URL:
https://github.com/auth0/Auth0.swift - Select the version that includes the fix (2.8.0 or later)
- Click Add Package
- Add the following to your
Podfile:pod 'Auth0', '~> 2.8'
- Run
pod installin your terminal - Open the
.xcworkspacefile generated by CocoaPods
- Add the following to your
Cartfile:github "auth0/Auth0.swift" ~> 2.8 - Run
carthage update --use-xcframeworks --platform iOS - Follow the Carthage integration guide to add the framework to your project
- Create a new file named
Auth0.plistin your Xcode project - Add your Auth0 credentials:
<?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>ClientId</key> <string>YOUR_AUTH0_CLIENT_ID</string> <key>Domain</key> <string>YOUR_AUTH0_DOMAIN</string> </dict> </plist>
Add the following URL scheme to your Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>None</string>
<key>CFBundleURLName</key>
<string>auth0</string>
<key>CFBundleURLSchemes</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>The fix for issue #950 prevents crashes related to continuation resume being called multiple times. To verify:
- Ensure you're using Auth0.swift version 2.8.0 or later
- Test Web Authentication flows in your application
- Check that authentication callbacks are handled correctly without crashes
- Build fails with "No such module 'Auth0'": Clean build folder (⌘ + Shift + K) and rebuild
- Callback URL not working: Verify your URL scheme matches your bundle identifier
- Xcode can't find the package: Check your internet connection and try resetting package caches