An Angeleno Account acts as a single sign-on for our public to access multiple City of Los Angeles services that have integrated Angeleno Account SSO login.
This repository is a Flutter based web-app that interfaces with Auth0 to handle user authentication and allows users to edit their Angeleno Account profile and their account security via multi-factor authentication.
The development branch is our main branch you can use to work on your own work/issues. To start development you'll git clone
this repo; after cloning you'll by default be on the development branch. When opening the pull request for your work, make sure the branch is being merged into development
branch as well.
-
Flutter >= 3.16.0
-
- Create Project and enable the following APIs:
-
- Create 2 Auth0 Apps:
- Single Page App for authenticating sessions used for the Flutter Auth0Web library
- Regular Web App for handling transactions with Auth0's API's (MFA, password changes, and writing user updates to Auth0)
- Create 2 Auth0 Apps:
After downloading the Flutter SDK, you'll be able to run
flutter doctor
which will give you details on anything you need to develop the application. As this app is only web-based for now you can safely ignore warnings around developing for Windows, Android, iOS, etc.
Making updates to .dart
files will require you to run flutter build web
so that the web app can recompile.
After building, you can use flutter run -d chrome
to run on Chrome. You can add additional devices (browsers) for cross-browser testing.
If you need to specify a web port to run the app on, you can append the argument --web-port=####
to the above - this will be helpful when testing redirects from external apps as it'll allow us to control a designated port.
In order for the code to pick your environment variables, you'll have to append --dart-define-from-file=.env
to your flutter run command.
On windows, you can run .\tests.bat
, which will run both dart analyze
to check linting and flutter test
to run unit tests.
Rename the .env-example
file to .env
and fill in the required environment variables.
In Auth0, you'll want to create a Single Page Application to get the appropriate values for the .env
file.
If you're using a cloud function without authorization, you will not need the Service Account variables, but the code will have to be modified.
The cloud functions being used can be found in the functions
directory. To run them locally, you can find instructions here. Once you have the functions running locally, you'll have to update the code in the locations (e.g. here) where the request is sent so that it points to your emulator.