Registry / auth-security / ory-hydra-client

ory-hydra-client

JSON →
library25.4.0pypypi✓ verified 83d ago

Python client for the Ory Hydra API, providing programmatic access to OAuth 2.0 and OpenID Connect functionality. Auto-generated from the official OpenAPI spec. Version 25.4.0 released 2025-04-27. Active development but versioning is tied to Hydra itself, not SDK maturity.

pip install ory-hydra-client
INSTALL
IMPORT
SIG · ORY-HYDRA-CLIENT
O
ory-hydra-client
auth-securitypythonv25.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

ApiClient
from ory_hydra_client import ApiClient
from ory_hydra_client import OryHydraApiClient
Configuration
from ory_hydra_client import Configuration
OAuth2Api
from ory_hydra_client import OAuth2Api

Initialize client with admin URL and optional API key. Replace localhost:4445 with your Hydra admin endpoint.

from ory_hydra_client import OryHydraApiClient from ory_hydra_client.configuration import Configuration config = Configuration(host=os.environ.get('HYDRA_ADMIN_URL', 'http://localhost:4445')) config.api_key['bearer'] = os.environ.get('HYDRA_API_KEY', '') api_client = OryHydraApiClient(configuration=config) api_instance = api_client.admin_api # Example: list OAuth2 clients try: clients = api_instance.list_o_auth2_clients() print(clients) except Exception as e: print(f"Error: {e}")
Debug
Known issues
breakingVersion 25.4.0 matches Hydra release version, not SDK stability. Breaking changes may occur between minor versions (e.g., 25.3.x -> 25.4.0). Pin exact version in production.
fix
pip freeze | grep ory-hydra-client && add `ory-hydra-client==25.4.0` to requirements.txt
affects: all
gotchaAuto-generated SDK; method names are verbatim from OpenAPI spec (e.g., `list_o_auth2_clients` with underscores). Always check generated docs for exact method signatures.
fix
Use IDE autocomplete or browse https://github.com/ory/sdk/tree/master/clients/hydra/python
affects: all
deprecatedOAuth2 token introspection/revocation endpoints are deprecated in Hydra 2.x+ in favor of Ory OAuth2 Access Control (Ory Oathkeeper or Ory Keto). Future SDK versions may remove these methods.
fix
Migrate to Ory Oathkeeper for token validation; see https://www.ory.sh/docs/hydra/deprecation
affects: >=2.0.0
gotchaEnvironment variable `HYDRA_ADMIN_URL` must NOT include a trailing slash. The SDK appends paths directly.
fix
Set HYDRA_ADMIN_URL=http://localhost:4445 (no slash at end)
affects: all
Upgrade
Version history
25.4.0latest on PyPI · released Nov 7, 2025
Audit
Dependencies
urllib3requiredHTTP client used internally
python-dateutilrequiredDate/time serialization
certifirequiredSSL certificate validation
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
ory-hydra-client — pip install ory-hydra-client · libregistry