This project implements a web application with a login system using Corbado's passkey-first authentication service integrated with a Flask backend. The application consists of two main pages: a login page and a home page. Once users log in successfully via the Corbado service on the login page, they are redirected to the home page where they can log out and view protected content.
Please see the full blog post to understand the detailed steps needed to integrate passkeys into Flask apps.
- Flask: A lightweight WSGI web application framework in Python, used to build the backend of the application.
- Corbado Python SDK: A comprehensive Python SDK for interacting with Corbado services.
- Python-dotenv: A Python package to read key-value pairs from a
.env
file and set them as environment variables. - HTML & CSS: Used to structure and style the frontend of the application.
- Passkey-first Authentication: Utilizes Corbado's authentication service for secure user login.
- Session management: Uses Corbado's session management to display content based on the user's authentication status.
Clone this repository to your local machine by running:
git clone https://github.com/corbado/example-passkeys-python-flask
To configure the credentials, you will need to create a .env
file with your Project ID
and API secret
from Corbado:
To get your Project ID
and API secret
visit your Corbado developer panel.
Please refer to the Corbado docs for more details on obtaining the necessary credentials and integrating Corbado authentication in your application.
PROJECT_ID=<your-project-id>
API_SECRET=<your-api-secret>
Use the following command to run the project in a docker container:
docker compose up
Open your browser and navigate to http://localhost:3000
to view the application.
Caution: On http://127.0.0.1:3000
passkeys will not work!