Skip to main content
image

Github   •   Documentation   •   Discord

👋 Server Auth

Pypi Version

Authenticate with a Caido instance using device code flow.

import asyncio
import os

from caido_server_auth import (
    AuthClient,
    AuthClientOptions,
    AuthenticationRequest,
    BrowserApprover,
)


def on_request(request: AuthenticationRequest) -> None:
    print(f"Visit: {request.verification_url}")
    print(f"Expires at: {request.expires_at.isoformat()}")


async def main() -> None:
    instance_url = os.environ.get("CAIDO_INSTANCE_URL", "http://localhost:8080")
    auth = AuthClient(
        AuthClientOptions(
            instance_url=instance_url,
            approver=BrowserApprover(on_request),
        )
    )
    token = await auth.start_authentication_flow()
    print(token.access_token)


asyncio.run(main())

Examples

See the examples directory for complete working examples:

  • examples/browser_auth.py - Manual approval via browser
  • examples/pat_auth.py - Automated approval using Personal Access Token

💚 Community

Come join our Discord community and connect with other Caido users! We'd love to have you as part of the conversation and help with any questions you may have.

Release files for caido-server-auth 0.1.2

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

Source distribution (sdist)

Source distribution for caido-server-auth 0.1.2
File Size Uploaded
caido_server_auth-0.1.2.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for caido-server-auth 0.1.2
File Interpreter ABI Platform
caido_server_auth-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / caido_server_auth-0.1.2.tar.gz

Download URL caido_server_auth-0.1.2.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eb2c25e9de15062760b68112f5d8e9ad63eeb1322518b90c1a0119a69a7524a4
BLAKE2b-256 checksum
How to use checksums
69be58cc2eaf97f729124b8939a9ea1c1a664b2d96dce0448788df073fca3ac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.8

Release files / caido_server_auth-0.1.2-py3-none-any.whl

Download URL caido_server_auth-0.1.2-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40c6cd3728e24cdff402c4efa5d8f55bf6e6cc73ac0169bdea1ad1e34faff8ff
BLAKE2b-256 checksum
How to use checksums
767b14d192151bcc3c1624cfb488c59ec03e96c1009d015089d729c1aecd26e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.8

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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