This sample application demonstrates the integration of the Auth0.swift SDK into a Swift iOS / macOS application. The sample is a companion to the Auth0 Swift Quickstart.
- iOS 12+ / macOS 10.15+
- Xcode 13.x
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). In the General tab, change the default bundle identifier from com.auth0.samples.SwiftSample to another value of your choosing.
Go to the settings page of your Auth0 application and add the following value to Allowed Callback URLs and Allowed Logout URLs, according to the platform of your application.
YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback
YOUR_BUNDLE_IDENTIFIER://YOUR_AUTH0_DOMAIN/macos/YOUR_BUNDLE_IDENTIFIER/callback
E.g. if your iOS bundle identifier was com.company.myapp and your Auth0 Domain was company.us.auth0.com, then this value would be:
com.company.myapp://company.us.auth0.com/ios/com.company.myapp/callback
⚠️ Make sure that the application type of the Auth0 application is Native. If you don’t have a Native Auth0 application, create one before continuing.
Back in Xcode, rename the Auth0.plist.example file to Auth0.plist, and replace the placeholder 71pp7e80LloIXsIwFi50F4zWKhRBehgG and demo-lw.us.auth0.com values with the Client ID and Domain of your Auth0 application. If you are using a Custom Domain, use the value of your Custom Domain instead of the value from the settings page.
<?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>71pp7e80LloIXsIwFi50F4zWKhRBehgG</string>
<key>Domain</key>
<string>demo-lw.us.auth0.com</string>
</dict>
</plist>For general support or usage questions, use the Auth0 Community forums or raise a support ticket. Only raise an issue if you have found a bug or want to request a feature.
Do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Auth0 helps you to:
- Add authentication with multiple sources, either social identity providers such as Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce (amongst others), or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS, or any SAML Identity Provider.
- Add authentication through more traditional username/password databases.
- Add support for linking different user accounts with the same user.
- Support for generating signed JSON Web Tokens to call your APIs and flow the user identity securely.
- Analytics of how, when, and where users are logging in.
- Pull data from other sources and add it to the user profile through JavaScript actions.
Why Auth0? Because you should save time, be happy, and focus on what really matters: building your product.
This project is licensed under the MIT license. See the LICENSE file for more information.