Registry / auth-security / pyop
library3.4.2pypypi✓ verified 82d ago

pyop is an OpenID Connect Provider (OP) library in Python, enabling applications to act as identity providers. It is actively maintained with a regular release cadence, adding new features, improving compatibility, and addressing bug fixes. The current version is 3.4.2.

pip install pyop
INSTALL
IMPORT
SIG · PYOP
P
pyop
auth-securitypythonv3.4.2
Install
6.7s avg
Import
Disk
69MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.930 runs
installs and imports cleanly · install 0.0s · import 0.000s · 68.5MB
glibc
py 3.103.930 runs
installs and imports cleanly · install 6.7s · import 0.000s · 69MB
69MB installed
● package 69MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Server
import pyop
from pyop import Server

This quickstart demonstrates how to initialize a basic pyop OpenID Connect Provider (OP) server using an in-memory dictionary storage. It sets up essential configuration like the issuer, JWKS URI, supported response types, and client information. For production environments, you would replace `DictStorage` with a persistent storage solution (e.g., `MongoStorage`, `RedisStorage`) and integrate the `Server` instance with your web framework (e.g., Flask, Django) to handle incoming OIDC requests at appropriate endpoints.

import os from pyop.server import Server from pyop.storage import DictStorage def create_op_server(): # In a real application, configuration would be loaded from a file or environment OP_BASE_URL = os.environ.get('OP_BASE_URL', 'http://localhost:8090') JWKS_URI = f'{OP_BASE_URL}/jwks.json' # Client information (for registered clients) # In a real scenario, this would come from a client registration process/database CLIENTS = { 'test_client': { 'client_id': 'test_client', 'client_secret': 'test_secret', 'redirect_uris': ['http://localhost:8000/cb'], 'response_types': ['code', 'id_token', 'code id_token'], 'scope': ['openid', 'profile', 'email'], 'subject_type': 'pairwise' } } # In-memory storage for demonstration purposes # For production, use MongoStorage, RedisStorage, or a custom persistent storage storage = DictStorage() storage.store_clients(CLIENTS) # Minimal server configuration server_config = { 'issuer': OP_BASE_URL, 'jwks_uri': JWKS_URI, 'authentication_methods': ['client_secret_basic'], 'response_types_supported': ['code', 'id_token', 'code id_token'], 'subject_types_supported': ['pairwise'], 'scopes_supported': ['openid', 'profile', 'email'], 'claims_supported': ['sub', 'name', 'email', 'given_name', 'family_name'] } op_server = Server(server_config, storage) print(f"OpenID Connect Provider Server initialized with issuer: {op_server.configuration.issuer}") return op_server if __name__ == '__main__': # Example usage: this only initializes the server, does not run a web server. # A production app would integrate this into Flask, Django, FastAPI, etc. # Example: op_server.handle_authentication_request(request_params, session_id) op = create_op_server() # You would then integrate 'op' with your web framework to handle OIDC endpoints.
Debug
Known issues
breakingVersion 3.0.0 reverted support for 'additional scopes' introduced in v2.1.0 and reimplemented it in a non-backwards compatible way.
fix
Review the v3.0.0 release notes and update any custom scope handling logic to align with the new implementation. Be prepared for changes in how custom scopes are defined and processed.
affects: <3.0.0 to 3.0.0+
gotchaWhen using PKCE support (introduced in v3.3.0), the library explicitly states that 'plaintext support is missing'.
fix
Ensure that your client applications use S256 (SHA256) as the code challenge method for PKCE, as plaintext (plain) is not supported by pyop.
affects: <3.3.0 to 3.3.0+
gotchaPrior to v3.4.1, pyop had compatibility issues with PyMongo 4, potentially leading to errors when using MongoStorage.
fix
Upgrade to pyop version 3.4.1 or newer if you are using PyMongo 4. Alternatively, downgrade PyMongo to a compatible version (e.g., PyMongo 3.x) for older pyop versions.
affects: 3.0.0 - 3.4.0
gotchaVersion 3.4.0 introduced support for a stateless code flow. If your application relies on stateful operations, upgrading might require attention to ensure existing state management patterns are compatible or if explicit stateless handling is desired.
fix
Review the documentation for the stateless code flow in v3.4.0+. If your application implicitly relied on state for certain operations, verify behavior or explicitly configure state management as needed.
affects: 3.0.0 - 3.3.x to 3.4.0+
Upgrade
Version history
3.4.2latest on PyPI · released Sep 3, 2025
Audit
Dependencies
oicrequiredCore dependency for OpenID Connect protocol handling.
pymongooptionalRequired for MongoStorage backend.
redisoptionalRequired for RedisStorage backend.
Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
pyop — pip install pyop · libregistry