This project contains an iOS application built with Swift and SwiftUI that works with a locally-running instance of FusionAuth, the authentication and authorization platform.
You will need the following things properly installed on your computer.
- Xcode: The official IDE for iOS development. Install it from the Mac App Store.
- Optional: An Apple Developer Account: Necessary for running your app on a device and publishing your app. You can still develop and test the app in a simulator without an account.
- Docker: The quickest way to stand up FusionAuth. Ensure you also have docker compose installed.
- (Alternatively, you can Install FusionAuth Manually).
The root of this project directory (next to this README) are two files: a Docker compose file and an environment variables configuration file. Assuming you have Docker installed on your machine, you can stand up FusionAuth up on your machine with:
docker compose up -d
The FusionAuth configuration files also make use of a unique feature of FusionAuth, called Kickstart: when FusionAuth comes up for the first time, it will look at the Kickstart file and mimic API calls to configure FusionAuth for use when it is first run.
NOTE: If you ever want to reset the FusionAuth system, delete the volumes created by Docker Compose by executing
docker compose down -v
.
FusionAuth will be initially configured with these settings:
- Your client Id is:
e9fdb985-9173-4e01-9d73-ac2d60d1dc8e
- Your client secret is:
super-secret-secret-that-should-be-regenerated-for-production
- Your example username is
[email protected]
and your password ispassword
. - Your admin username is
[email protected]
and your password ispassword
. - Your fusionAuthBaseUrl is
http://localhost:9011/
You can log into the FusionAuth admin UI and look around if you want, but with Docker/Kickstart you don't need to.
-
Open the
ChangeBank.xcodeproj
file in this project'scomplete-application
folder in Xcode. -
Open the
ChangeBank.plist
file in thecomplete-application
folder in a text editor.- Change the issuer and clientId values to match that of your FusionAuth instance. If you used the default Docker and Kickstart, you don't need to change anything.
-
Build and run the app following XCode guidelines. The app will open in the iOS simulator, or your connected iOS device. You can usually press the "play" button in the top left of XCode or press
command-r
to build and run the app with the default settings.
Visit https://fusionauth.io/docs/quickstarts/quickstart-swift-ios-native for a step-by-step guide on how to build this iOS app from scratch, including more details about the tenant and application settings.