Skip to main content

open-passkey-flask

Flask blueprint for passkey (WebAuthn/FIDO2) authentication. Thin wrapper around open-passkey-server -- registers routes, parses requests, returns JSON responses.

Install

pip install open-passkey-flask

Quick Start

from flask import Flask
from open_passkey_flask import (
    create_passkey_blueprint,
    PasskeyConfig,
    MemoryChallengeStore,
    MemoryCredentialStore,
)

app = Flask(__name__)

passkey_bp = create_passkey_blueprint(PasskeyConfig(
    rp_id="localhost",
    rp_display_name="My App",
    origin="http://localhost:5000",
    challenge_store=MemoryChallengeStore(),
    credential_store=MemoryCredentialStore(),
))

app.register_blueprint(passkey_bp, url_prefix="/passkey")

With Sessions

from open_passkey_server.session import SessionConfig

passkey_bp = create_passkey_blueprint(PasskeyConfig(
    rp_id="example.com",
    rp_display_name="Example",
    origin="https://example.com",
    session=SessionConfig(secret="your-32+-character-hmac-secret"),
))

When session is configured, two additional routes are registered and login/register responses set an HttpOnly session cookie automatically.

Routes

Method Path Description
POST /register/begin Start registration ceremony
POST /register/finish Complete registration
POST /login/begin Start authentication ceremony
POST /login/finish Complete authentication
GET /session Validate session cookie (session config required)
POST /logout Clear session cookie (session config required)

API

create_passkey_blueprint(config: PasskeyConfig) -> Blueprint

Returns a Flask Blueprint with the routes above. Mount it at any URL prefix.

Dependencies

  • flask>=3.0
  • open-passkey-server
  • open-passkey -- core WebAuthn verification
  • open-passkey-server -- shared server logic
  • open-passkey-fastapi, open-passkey-django -- alternative framework bindings
  • @open-passkey/sdk (npm) -- browser SDK

License

MIT

Metadata

Release files for open-passkey-flask 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for open-passkey-flask 0.1.4
File Size Uploaded
open_passkey_flask-0.1.4.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for open-passkey-flask 0.1.4
File Interpreter ABI Platform
open_passkey_flask-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / open_passkey_flask-0.1.4.tar.gz

Download URL open_passkey_flask-0.1.4.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d2ea3902a9c586768faf55f770df38db3e100f5c9bed3b9bc719745f6d8c2370
BLAKE2b-256 checksum
How to use checksums
370a837ddcc04b49723b7c6157a4d64773a3da29083d6351e2689d87f86d3f1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / open_passkey_flask-0.1.4-py3-none-any.whl

Download URL open_passkey_flask-0.1.4-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca76875dd5123906d0fe58a27232ba8957204284545eb2727f391308fd1f7ae3
BLAKE2b-256 checksum
How to use checksums
c9dd090b079b03b323b4576405ad159b224e16bb6b94bd38533fe566279ddc56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page