{"id":13320457,"url":"https://github.com/teamhanko/passkeys-python","last_synced_at":"2025-04-15T18:24:10.603Z","repository":{"id":229147828,"uuid":"775856490","full_name":"teamhanko/passkeys-python","owner":"teamhanko","description":"A Python Flask example app with passkey authentication, using Hanko Passkey API","archived":false,"fork":false,"pushed_at":"2024-05-02T11:47:44.000Z","size":2353,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T17:13:02.644Z","etag":null,"topics":["flask","passkeys","python"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teamhanko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-03-22T07:18:14.000Z","updated_at":"2025-02-18T15:35:55.000Z","dependencies_parsed_at":"2024-03-22T10:05:53.718Z","dependency_job_id":"10ab019f-f7d5-4b07-bd07-c9966ff5383e","html_url":"https://github.com/teamhanko/passkeys-python","commit_stats":null,"previous_names":["ashutosh-bhadauriya/passkeys-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teamhanko","download_url":"https://codeload.github.com/teamhanko/passkeys-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249127032,"owners_count":21216905,"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":["flask","passkeys","python"],"created_at":"2024-07-29T18:36:08.893Z","updated_at":"2025-04-15T18:24:10.583Z","avatar_url":"https://github.com/teamhanko.png","language":"TypeScript","readme":"# Integrating Passkey Authentication in a Python Flask App\n\nThis repository demonstrates how to add passkey login functionality to your Flask backend and React frontend using the Hanko Passkey API. Passkey authentication is a secure and user-friendly alternative to traditional password-based authentication, providing a seamless login experience for users.\n\nFor a detailed tutorial on implementing passkey login in your Python Flask app, refer to our blog post: [Integrate passkeys into your Python Flask app](https://www.hanko.io/blog/passkeys-python-flask)\n\n![Passkey demo](/passkey.gif)\n\n## Prerequisites\n\nBefore you begin, ensure you have the following:\n\n- Python installed (version 3.0.0 or later)\n- Node.js installed (version 20.0.0 or later)\n- Hanko Passkey API key and tenant ID from [Hanko Cloud](https://cloud.hanko.io/)\n\n\u003e **Note:**\n\u003e You'll need to create a Passkey Project on Hanko Cloud with the App URL `http://localhost:5173`. See our docs to learn how to setup a [passkey project](https://docs.hanko.io/passkey-api/setup-passkey-project).\n\n## Getting started\n\n1. Clone the repository\n\n```bash\ngit clone https://github.com/teamhanko/passkeys-python.git\n```\n\n2. Set up environment variables\n\nCreate a `.env` file in the `python-backend` directory and add the following environment variables:\n\n```sh\nPASSKEY_API_KEY=your-hanko-passkey-api-key\nPASSKEY_TENANT_ID=your-hanko-passkey-tenant-id\n```\n\nReplace `your-hanko-passkey-api-key` and `your-hanko-passkey-tenant-id` with your actual Hanko Passkey API key and tenant ID.\n\n#### Frontend\n\n1. Navigate to the frontend directory:\n\n```bash\ncd react-frontend\n```\n\n2. Install the frontend dependencies using your preferred package manager (e.g., `npm`, `pnpm`, `yarn`, or `bun`). For this project, we've used `pnpm`:\n\n```bash\npnpm install\n```\n\n3. Start the frontend development server:\n\n```bash\npnpm dev\n```\n\n#### Backend\n\n1. Navigate to the backend directory:\n\n```bash\ncd python-backend\n```\n\n2. Install the backend dependencies using `pip`:\n\n```bash\npip install -r requirements.txt\n```\n\n3. Start the backend server:\n\n```bash\nflask run --port=8000\n```\n\n## Usage\n\n1. Start the application:\n   \n   * Ensure that both the frontend and backend servers are running.\n\n   * Access the application by navigating to http://localhost:5173 in your web browser.\n  \n2. Log in with a pre-configured user: Navigate to login page, login with one of the pre-configured users.\n\n```json\n    {\n        \"id\": \"b3fbbdbd-6bb5-4558-9055-3b54a9469629\",\n        \"email\": \"john.doe@example.com\",\n        \"password\": \"password123\",\n    },\n    {\n        \"id\": \"22c81b3d-1e7d-4a72-a6b0-ad946e0c0965\",\n        \"email\": \"sergio_mq@example.com\",\n        \"password\": \"very_secure_password\",\n    },\n    {\n        \"id\": \"55c81b3d-1e7d-4a72-a6b0-ad946e0c0965\",\n        \"email\": \"ab@g.com\",\n        \"password\": \"123\",\n    }\n```\n\n3. Register a passkey:\n   \n   * After logging in, register a passkey for the logged-in user.\n\n\n4. Log out:\n   * After the passkey registration is successful, log out of the application.\n\n5. Login with with a passkey\n\n   * On the login page, choose sign in with a passkey option to authenticate using a passkey.\n\n## Support\n\nFeel free to reach out to us on [Discord](https://hanko.io/community) if you get into any issues.\n\n## License\n\nThis project is licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamhanko%2Fpasskeys-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamhanko%2Fpasskeys-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamhanko%2Fpasskeys-python/lists"}