
This is a sample implementation of the Corbado passkeys-first authentication solution using Python with Flask. The following packages are being used:
app
: The Flask projectapp/__init__.py
: The initialization file for the Flask appapp/models.py
: Defines our custom user modelapp/config.py
: Flask configuration that should be available throughout our appapp/decorators.py
: Decorators to force authentication on API routesapp/routes.py
: Contains the routes for our applicationapp/project.db
: The sqlite database instancetemplates/
: The Flask project templates
Please follow the steps in Getting started to create and configure a project in the Corbado developer panel.
You need to have Python and pip
installed to run it.
Use the values you obtained in Prerequisites to configure the following variables inside a .env
file you create in the root folder of this project:
CORBADO_PROJECT_ID=pro-XXX
CORBADO_API_SECRET=corbado1_XXX
CORBADO_FRONTEND_API=https://${CORBADO_PROJECT_ID}.frontendapi.cloud.corbado.io
CORBADO_BACKEND_API=https://backendapi.cloud.corbado.io
Run
python -m venv venv
to create a virtual environment.
Then, activate the virtual environment with
source venv/bin/activate
or
venv\Scripts\activate
on Windows.
To install all dependencies, run
pip install -r requirements.txt
Migrate your database by running
flask db upgrade
Now you can start the server by running
python run.py
- Community for Developer Support: https://bit.ly/passkeys-community
- Passkeys Debugger: https://www.passkeys-debugger.io/
- Passkey Subreddit: https://www.reddit.com/r/passkey/
This example application uses telemetry. By gathering telemetry data, we gain a more comprehensive understanding of how our SDKs, components, and example applications are utilized across various scenarios. This information is crucial in helping us prioritize features that are beneficial and impactful for the majority of our users. Read our official documentation for more details.
To disable telemetry, add the following line to your .env
file:
CORBADO_TELEMETRY_DISABLED=true