Skip to main content

Authenticate with a Caido instance.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caido_server_auth-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

caido_server_auth-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file caido_server_auth-0.1.1.tar.gz.

File metadata

  • Download URL: caido_server_auth-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.8

File hashes

Hashes for caido_server_auth-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f60419544bd5eecc1f2e152d786faefc9fd5c07365c5d46566ec94dc8c204eae
MD5 1a408cc376e8f6d875395f141d0eb35a
BLAKE2b-256 efc1c581b492b992232612d6570479a2ab376b7ab5d070ec1379824fb9d15320

See more details on using hashes here.

File details

Details for the file caido_server_auth-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for caido_server_auth-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e192fe9ea96c33c466851ac9412f9fbf5503e5ad6f8c89ed060f6938219086a
MD5 5fcc8962c407eb105f4a1ed40b3ba52b
BLAKE2b-256 b8333d01d0cd6c6f77097b67433b1b2b54145f9a4d5232cac0834dfd9a0512ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page