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.0.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.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for caido_server_auth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed92a04947a86976d22a8837ae8bca9c75116d2f08792b980d2b0787464230ee
MD5 1290c0411397997b42dc1fb6d2c38903
BLAKE2b-256 4483d5b94fab3e39c32f293eeeec1f1019720e9ab1fac22e9a47c0a730971d70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caido_server_auth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4329e9742717dfae6b51b1b08ebd4cba5693e9f7b344b6622006208fb98acba3
MD5 89dac3d9ee05f0697a89183026b73964
BLAKE2b-256 2d0ba4b252f611f5fc8e75bb026489348709ce3205fac15dc33bab1b6d859f38

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