Skip to main content

Authly Python SDK

PyPI version Python versions License: MIT

A lightweight and secure Python library for building authentication systems using Authly. This SDK provides simple tools to verify JWT tokens against Authly's identity provider.

Installation

Install using pip:

pip install authly-sdk

Or using uv:

uv add authly-sdk

Quick Start

from authly_sdk import AuthlyClient, TokenInvalidError, TokenExpiredError

# 1. Initialize the client
client = AuthlyClient(
    issuer="https://auth.example.com",
    audience="your-api-identifier"
)

# 2. Verify a token
try:
    token = "eyJhbGciOiJSUzI1NiIs..."
    claims = client.verify(token)
    
    # Access standard and custom claims with full IDE support
    print(f"User Subject: {claims['sub']}")
    print(f"Session ID: {claims['sid']}")
    print(f"Permissions: {claims['permissions']}")
    
except TokenExpiredError:
    print("The token has expired")
except TokenInvalidError as e:
    print(f"Invalid token: {e}")

Advanced Configuration

You can customize the JWKS path or allowed algorithms:

client = AuthlyClient(
    issuer="https://auth.example.com",
    audience="your-api",
    jwks_path="/.well-known/jwks.json",
    algorithms=["RS256"]
)

Development

We use uv for dependency management.

# Install dev dependencies
uv sync --dev

# Run type checks
uv run basedpyright src

# Format code
uv run ruff format .

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for authly-sdk 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 authly-sdk 0.1.4
File Size Uploaded
authly_sdk-0.1.4.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for authly-sdk 0.1.4
File Interpreter ABI Platform
authly_sdk-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / authly_sdk-0.1.4.tar.gz

Download URL authly_sdk-0.1.4.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ae8614f0c26ebae542c38e75786291e97463be3c70041c137d12062d2c224095
BLAKE2b-256 checksum
How to use checksums
056ddccfe437f7979208588933d4921839bc29c63ef146756b1841a38479e9a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL authly_sdk-0.1.4-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d2d2071f4f52765705740bc8e243bea66f58ae49206be6ae0be7706da309a6d
BLAKE2b-256 checksum
How to use checksums
cad23ce40fb62beb7a9e4e3d34a58050ed4fc02d1b3a0673ff5973db8b56c9ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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