{"id":21590235,"url":"https://github.com/corbado/example-passkeys-fastapi","last_synced_at":"2025-04-10T22:17:35.149Z","repository":{"id":213292852,"uuid":"728748505","full_name":"corbado/example-passkeys-fastapi","owner":"corbado","description":"Python FastAPI passkey repository of a sample app that offers passkey authentication.","archived":false,"fork":false,"pushed_at":"2024-10-26T10:28:58.000Z","size":46,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-10T22:17:30.626Z","etag":null,"topics":["faceid","fastapi","fido2","passkey","passkeys","python","touchid","webauthn"],"latest_commit_sha":null,"homepage":"https://www.corbado.com/passkeys/fastapi","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corbado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-07T15:55:34.000Z","updated_at":"2025-01-12T17:57:31.000Z","dependencies_parsed_at":"2023-12-19T16:15:53.793Z","dependency_job_id":"2eedf1d2-b8e7-450f-84f7-180a3ab8f578","html_url":"https://github.com/corbado/example-passkeys-fastapi","commit_stats":null,"previous_names":["corbado/example-passkeys-fastapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-passkeys-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-passkeys-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-passkeys-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-passkeys-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corbado","download_url":"https://codeload.github.com/corbado/example-passkeys-fastapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305837,"owners_count":21081575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faceid","fastapi","fido2","passkey","passkeys","python","touchid","webauthn"],"created_at":"2024-11-24T16:17:12.181Z","updated_at":"2025-04-10T22:17:35.124Z","avatar_url":"https://github.com/corbado.png","language":"Python","readme":"# FastAPI Passkey Example App\n\n## Project Overview\n\nThis project implements a web application with a login using Corbado's passkey-first authentication service\nintegrated with a FastAPI backend. The application consists of two main pages: a login page and a home page. Once users\nlog in successfully via the Corbado on the login page, they are redirected to the home page where they can log\nout and view protected content.\n\nPlease see the [full blog post](https://www.corbado.com/blog/passkeys-fastapi) to understand all the required steps to integrate passkeys into FastAPI apps.\n\n\n## Tools and Technologies Used\n\n- **FastAPI**: A full-featured Python web framework, used to build the backend of the application.\n- **Corbado**: An authentication service used to handle passkey-first user authentication.\n- **HTML \u0026 CSS**: Used to structure and style the frontend of the application.\n\n## Features\n\n- **Passkey-first Authentication**: Utilizes Corbado's authentication service for secure user login.\n- **Session management**: Uses Corbado's session management to display content based on the user's authentication status.\n\n## How to Use\n\n### 1. File structure\n```\n├── .env                 # Contains all environment variables\n├── main.py              # Contains our webapplication (Handles routes)\n└── templates\n    ├── index.html       # Login page\n    └── profile.html     # Profile page\n```\n\n### 2. Setup\n#### Step 2.1: Clone the Repository\n\nClone this repository to your local machine by running:\n\n```sh\ngit clone https://github.com/corbado/example-passkeys-fastapi\n\n```\n\n#### Step 2.2: Create .env File\n\nTo configure the credentials, you will need to create a `.env` file with your Corbado `Project ID` and `API secret`:\nTo get your `Project ID` and `API secret`, visit the [Corbado developer panel](https://app.corbado.com/?technology=passkeys\u0026framework=FastAPI#signup-init).\n\nPlease refer to the [Corbado docs](https://docs.corbado.com/overview/welcome) for more details on obtaining the\nnecessary credentials and integrating Corbado authentication in your application.\n\n```sh\nPROJECT_ID=\u003cyour-project-id\u003e\nAPI_SECRET=\u003cyour-api-secret\u003e\n\n```\n\n#### Step 2.3: Configure Corbado project\n\nIn 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:\n![Corbado Developer Panel FastAPI URLs](https://github.com/user-attachments/assets/9fdc7edc-2bba-4a82-880b-27a931b84e03)\n\n\n#### Step 2.4: Run the Project\n\nUse the following command to run the project in a docker container:\n\n```sh\ndocker compose up\n```\n\n### 3. Usage\n\nAfter step [2.4](#step-24-run-the-project), your local server should be fully working.\n\nIf you now visit [http://localhost:3000](http://localhost:3000), you should be able to sign up using the Corbado UI component.\n\n\u003cimg width=\"1177\" alt=\"fastapi passkeys ui component\" src=\"https://github.com/user-attachments/assets/287b8c4b-e18d-4d76-9ec0-0e86985d656b\"\u003e\n\nWhen authenticated you will be forwarded to the `/profile` page.\n\n\u003cimg width=\"1434\" alt=\"fastapi passkey list\" src=\"https://github.com/user-attachments/assets/5479506e-6c70-4202-8174-9c5f2caea52e\"\u003e\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fexample-passkeys-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorbado%2Fexample-passkeys-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fexample-passkeys-fastapi/lists"}