Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Endevre ID Python Client

A Python helper library for interacting with Endevre ID authentication services. It mirrors the core workflows of the browser client with a server-friendly API.

Features

  • Build secure login URLs for Endevre ID SSO flows.
  • Exchange authorization codes for tokens (optionally requesting JWTs).
  • Refresh access tokens using stored refresh tokens.
  • Retrieve user information from tokens or the Endevre ID API.
  • Optional JWT validation backed by the public signing key.
  • Standards-based OIDC access-token validation from discovery and rotating JWKS.
  • Explicit legacy, dual, and oidc migration modes with no silent downgrade.

Installation

pip install endevre-id-client

Quick start

from endevre_id_client import EndevreClient

client = EndevreClient(
    client_id="<your client id>",
    client_secret="<your client secret>",
)

login_url = client.getLoginUrl(
    final_redirect_uri="https://app.example.com/auth/callback",
    redirect_uris=["https://app.example.com/start"],
)

# After your user completes the flow and you receive the `code`
exchange_result = client.exchange(code)
user_info = client.getUserInfo(exchange_result.token)
refreshed = client.refreshToken(exchange_result.refresh)

OIDC resource-server validation

OIDC support is additive. Existing construction remains in legacy mode by default. A resource server can opt into OIDC without changing the application user identifier:

from endevre_id_client import EndevreClient

client = EndevreClient(
    client_id="<your client id>",
    protocol="oidc",
)

claims = client.validateToken(bearer_token)
application_user_id = claims["sub"]
assert claims["userId"] == application_user_id

The OIDC sub is the same client-specific identifier issued by the legacy Endevre flow. userId is included as a compatibility alias. Validation requires an at+jwt RS256 access token and verifies its signature, issuer, audience, expiry, client_id, jti, and required claims. Discovery is cached for one hour and JWKS for five minutes by default; an unknown key ID or signature change triggers one bounded refresh so signing-key rotation does not require an application deployment.

During a staged migration, configure protocol="dual" and retain the client secret:

client = EndevreClient(
    client_id="<your client id>",
    client_secret="<your legacy client secret>",
    protocol="dual",
)

Dual mode routes tokens by their signed-token shape and exact issuer. An OIDC validation error never falls back to legacy validation. Legacy is still the default only for compatibility while consumers migrate. The stable package is bound to https://id.endevre.com; consumer configuration cannot replace the issuer. Tagged dev and beta prereleases are bound to their exact stage during their controlled build.

getUserInfo() validates OIDC locally first and then calls the discovered UserInfo endpoint. It rejects a UserInfo response whose sub differs from the validated access token.

Deliberate API boundary

This release adds resource-server validation; it does not add a second authorization-code client implementation. In oidc mode, the legacy getLoginUrl(), exchange(), and refreshToken() methods fail closed. Web applications should use the Endevre JavaScript SDK or another conformant OIDC relying-party library for the browser authorization-code flow. In legacy and dual modes those existing methods keep their current behavior during the migration window.

Publishing

Automated publishing mirrors the JavaScript package strategy:

  • Pushes to master publish the version defined in pyproject.toml as the stable release.
  • Pushes to beta publish a time-stamped pre-release bound to the beta issuer and API (e.g. 0.1.0b20241006123000).
  • Pushes to dev publish a time-stamped development build bound to the dev issuer and API (e.g. 0.1.0.dev20241006123000).
  • Pushes to justin* / ray* branches run tests only (no publish).

All workflows live under .github/workflows/python-ci-cd.yml and rely on the PYPI_API_TOKEN secret (or PyPI Trusted Publisher configuration) for auth.

Development

Install dev dependencies:

pip install -e .[dev]

Run the test suite:

pytest

Metadata

Release files for endevre-id-client 0.1.1.dev20260727181658

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

Source distribution (sdist)

Source distribution for endevre-id-client 0.1.1.dev20260727181658
File Size Uploaded Provenance Actions
endevre_id_client-0.1.1.dev20260727181658.tar.gz 13.5 kB With provenance Details for endevre_id_client-0.1.1.dev20260727181658.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for endevre-id-client 0.1.1.dev20260727181658
File Interpreter ABI Platform Actions
endevre_id_client-0.1.1.dev20260727181658-py3-none-any.whl Python 3 none any Details for endevre_id_client-0.1.1.dev20260727181658-py3-none-any.whl

Total release size: 27.2 kB

Release files / endevre_id_client-0.1.1.dev20260727181658.tar.gz

Download URL endevre_id_client-0.1.1.dev20260727181658.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8007f26174f75a16232b1f6505c8bd9bb9d52b7fa24f036fda6e1138f496a6c5
BLAKE2b-256 checksum
How to use checksums
a702b946daf26f1b13f0681bb4e81bba58952720107f1b74e82246497a96d3ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Release files / endevre_id_client-0.1.1.dev20260727181658-py3-none-any.whl

Download URL endevre_id_client-0.1.1.dev20260727181658-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8de1de2ea27834324f448ba256a211dc7847d2a38fa9a5c8dacdc206237c1e4e
BLAKE2b-256 checksum
How to use checksums
29ae35297e384a05886ae5d438fb3777b84f688d6f050bece81c863e9360f1ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Security for endevre-id-client 0.1.1.dev20260727181658

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for endevre_id_client-0.1.1.dev20260727181658.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

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.

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