PassmanAI Python SDK
Official Python SDK for integrating "Sign in with Passman" into any Python web framework (FastAPI, Django, Flask, etc.).
PassmanAI is a decentralized, post-quantum password manager with zero-knowledge architecture. This SDK provides a robust, PKCE-secured OpenID Connect (OIDC) client that makes it trivial to authenticate users via Passman.
Quick Start
1. Install
pip install passmanai
2. Configure Environment Variables
Set your Passman API credentials in your environment:
PASSMAN_CLIENT_ID=your_client_id
PASSMAN_CLIENT_SECRET=your_client_secret
PASSMAN_REDIRECT_URI=http://localhost:8000/auth/callback
PASSMAN_ISSUER_URL=http://localhost:4010
Get your client credentials by registering an OIDC client in your PassmanAI dashboard.
3. Basic Usage (Framework Agnostic)
The SDK provides a PassmanClient that handles OIDC discovery, PKCE generation, and token exchange.
from passmanai import PassmanClient
# Initialize the client (automatically loads from env vars)
passman = PassmanClient()
# 1. Generate the authorization URL and PKCE state
auth_url, state, code_verifier = passman.get_authorization_url()
# Save `state` and `code_verifier` in your session, then redirect the user to `auth_url`.
# ... user logs in on Passman and gets redirected to your callback ...
# 2. Exchange the authorization code for a token and user profile
# In your callback route, reconstruct the full URL requested:
callback_url = "http://localhost:8000/auth/callback?code=...&state=..."
profile, tokens = passman.fetch_user_profile(
authorization_response_url=callback_url,
state=saved_state_from_session,
code_verifier=saved_code_verifier_from_session
)
print(f"Logged in as: {profile['preferred_username']} (ID: {profile['sub']})")
Advanced Configuration
You can explicitly pass credentials if you prefer not to use environment variables:
passman = PassmanClient(
client_id="your_client_id",
client_secret="your_client_secret",
redirect_uri="https://myapp.com/auth/callback",
issuer_url="https://passmanai.com" # Defaults to https://passmanai.com if not set
)
Security
- PKCE enforced — Prevents authorization code interception attacks.
- State parameter — Protects against CSRF attacks.
- Built on top of Authlib, the industry standard for Python OAuth/OIDC.
Metadata
Release files for passmanai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| passmanai-0.1.0.tar.gz | 4.7 kB | Without provenance | Details for passmanai-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| passmanai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for passmanai-0.1.0-py3-none-any.whl |
Total release size: 9.7 kB
Release files / passmanai-0.1.0.tar.gz
| Download URL | passmanai-0.1.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee705201ab6a7aab5bc8fa52fa87ccf4c7e4114ece30bdf380e2e59b06b87bd1
|
|
BLAKE2b-256 checksum How to use checksums |
a74f19d37d5ab3c14c52bd3f451dd62da3eb0e20a77b7f86b2c8dd2516730ea8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / passmanai-0.1.0-py3-none-any.whl
| Download URL | passmanai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56dc3683d2c22752e1d787b29d41f53546848e3a3d149824e6333cfc76e8f5df
|
|
BLAKE2b-256 checksum How to use checksums |
f144ae4ddefe8f0a50973729f3a7f6bc808f73057b1e55b9cc37facce7986b82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for passmanai 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.