Python SDK for Zisu OIDC and embedded launch ticket login.
Project description
zisu-app-sdk
Python SDK for Zisu OIDC login and embedded iframe launch ticket login.
Core usage
from zisu_app_sdk import ZisuOIDCClient
client = ZisuOIDCClient(
issuer="http://127.0.0.1:3005",
client_id="essay-helper",
client_secret="zisu-dev-secret",
redirect_uri="http://127.0.0.1:8000/auth/zisu/callback",
)
auth = client.get_authorization_url()
print(auth.url)
result = client.exchange_launch_ticket(
launch_ticket="...",
expected_nonce="nonce-from-frame",
)
print(result.user.sub)
FastAPI helper
from fastapi import FastAPI
from zisu_app_sdk import ZisuFastAPIAuth, ZisuOIDCClient
app = FastAPI()
client = ZisuOIDCClient(
issuer="http://127.0.0.1:3005",
client_id="essay-helper",
client_secret="zisu-dev-secret",
redirect_uri="http://127.0.0.1:8000/auth/zisu/callback",
)
auth = ZisuFastAPIAuth(client, app_session_secret="change-me")
app.include_router(auth.router())
Set cookie_secure=True when the app is served over HTTPS.
Routes added by the helper:
GET /login/zisuGET /auth/zisu/callbackPOST /auth/zisu/embedGET /api/me
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
zisu_app_sdk-0.3.0.tar.gz
(11.3 kB
view details)
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 zisu_app_sdk-0.3.0.tar.gz.
File metadata
- Download URL: zisu_app_sdk-0.3.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ea3dc274670345780aeabc7948e47687686265de04ac14f0b4c3004c86ec692
|
|
| MD5 |
46baae0fa6f449de3cfd6982fe0984d9
|
|
| BLAKE2b-256 |
97098c4d7e04e9d8e98b3b917cb7b0025d5e29d4c7517d67e62d3caf20841605
|
File details
Details for the file zisu_app_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: zisu_app_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd35556310f2f53fca3ce04997ac410d68f3654c62ebd76b2eefd536bd073a50
|
|
| MD5 |
5736c71f5ed50586b069ae44fde8521a
|
|
| BLAKE2b-256 |
654021ed04826b42442fd5cbc04ead72ce62cd8748ecd0f7c3bdcdfe8fad955e
|