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.

Metadata

Release files for caido-server-auth 0.1.3

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.3
File Size Uploaded
caido_server_auth-0.1.3.tar.gz 6.7 kB Details

Built distribution (wheel)

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

Total release size: 17.1 kB

Release files / caido_server_auth-0.1.3.tar.gz

Download URL caido_server_auth-0.1.3.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5eeaa54bd5f8cb840c44afa31cba628aecccc845c9652713ed1028747c31b070
BLAKE2b-256 checksum
How to use checksums
8d9f85674f74aa3ac05124c8bcd73315f6b4fdb606c702683baf43229f0b9928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.8

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

Download URL caido_server_auth-0.1.3-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d7d4eac99f9b811d9771b9c856a67229fc1ddad0d887cc16792c1c98f20e7d9
BLAKE2b-256 checksum
How to use checksums
51bc5d6d7ab9c42f92319544bf4ddb7c1fc3f2f9808c7b84f88867ea86bf894e
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.3 This release

2 release files

0.1.2

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