Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corbado/example-passkeys-fastapi
Python FastAPI passkey repository of a sample app that offers passkey authentication.
https://github.com/corbado/example-passkeys-fastapi
faceid fastapi fido2 passkey passkeys python touchid webauthn
Last synced: 28 days ago
JSON representation
Python FastAPI passkey repository of a sample app that offers passkey authentication.
- Host: GitHub
- URL: https://github.com/corbado/example-passkeys-fastapi
- Owner: corbado
- Created: 2023-12-07T15:55:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-21T08:26:49.000Z (2 months ago)
- Last Synced: 2024-10-21T11:38:46.836Z (2 months ago)
- Topics: faceid, fastapi, fido2, passkey, passkeys, python, touchid, webauthn
- Language: HTML
- Homepage: https://www.corbado.com/passkeys/fastapi
- Size: 43.9 KB
- Stars: 9
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI Passkey Example App
## Project Overview
This project implements a web application with a login using Corbado's passkey-first authentication service
integrated with a FastAPI backend. The application consists of two main pages: a login page and a home page. Once users
log in successfully via the Corbado 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](https://www.corbado.com/blog/passkeys-fastapi) to understand all the required steps to integrate passkeys into FastAPI apps.
## Tools and Technologies Used
- **FastAPI**: A full-featured Python web framework, used to build the backend of the application.
- **Corbado**: An authentication service used to handle passkey-first user authentication.
- **HTML & CSS**: Used to structure and style the frontend of the application.## Features
- **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.## How to Use
### 1. File structure
```
├── .env # Contains all environment variables
├── main.py # Contains our webapplication (Handles routes)
└── templates
├── index.html # Login page
└── profile.html # Profile page
```### 2. Setup
#### Step 2.1: Clone the RepositoryClone this repository to your local machine by running:
```sh
git clone https://github.com/corbado/example-passkeys-fastapi```
#### Step 2.2: Create .env File
To configure the credentials, you will need to create a `.env` file with your Corbado `Project ID` and `API secret`:
To get your `Project ID` and `API secret`, visit the [Corbado developer panel](https://app.corbado.com/?technology=passkeys&framework=FastAPI#signup-init).Please refer to the [Corbado docs](https://docs.corbado.com/overview/welcome) for more details on obtaining the
necessary credentials and integrating Corbado authentication in your application.```sh
PROJECT_ID=
API_SECRET=```
#### Step 2.3: Configure Corbado project
In the Corbado developer panel, visit the [URLs settings](https://app.corbado.com/app/settings/general/urls) and enter the values shown in the image below:
![Corbado Developer Panel FastAPI URLs](https://github.com/user-attachments/assets/9fdc7edc-2bba-4a82-880b-27a931b84e03)#### Step 2.4: Run the Project
Use the following command to run the project in a docker container:
```sh
docker compose up
```### 3. Usage
After step [2.4](#step-24-run-the-project), your local server should be fully working.
If you now visit [http://localhost:3000](http://localhost:3000), you should be able to sign up using the Corbado UI component.
When authenticated you will be forwarded to the `/profile` page.