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.2.tar.gz (6.6 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.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for caido_server_auth-0.1.2.tar.gz
Algorithm Hash digest
SHA256 eb2c25e9de15062760b68112f5d8e9ad63eeb1322518b90c1a0119a69a7524a4
MD5 a1ebfa0ed5ab779694b76f7c8580ea11
BLAKE2b-256 69be58cc2eaf97f729124b8939a9ea1c1a664b2d96dce0448788df073fca3ac9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caido_server_auth-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40c6cd3728e24cdff402c4efa5d8f55bf6e6cc73ac0169bdea1ad1e34faff8ff
MD5 b214e608f53b1492c04bbd197fe7b9f4
BLAKE2b-256 767b14d192151bcc3c1624cfb488c59ec03e96c1009d015089d729c1aecd26e9

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