Authenticate with a Caido instance.
Project description
👋 Server Auth
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 browserexamples/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed92a04947a86976d22a8837ae8bca9c75116d2f08792b980d2b0787464230ee
|
|
| MD5 |
1290c0411397997b42dc1fb6d2c38903
|
|
| BLAKE2b-256 |
4483d5b94fab3e39c32f293eeeec1f1019720e9ab1fac22e9a47c0a730971d70
|
File details
Details for the file caido_server_auth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: caido_server_auth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4329e9742717dfae6b51b1b08ebd4cba5693e9f7b344b6622006208fb98acba3
|
|
| MD5 |
89dac3d9ee05f0697a89183026b73964
|
|
| BLAKE2b-256 |
2d0ba4b252f611f5fc8e75bb026489348709ce3205fac15dc33bab1b6d859f38
|