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.4.0.tar.gz
(9.2 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.4.0.tar.gz.
File metadata
- Download URL: zisu_app_sdk-0.4.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09de54aa8bed1665d64a2404291495f2cf18acdfd4188c60cd3ab29ad4083862
|
|
| MD5 |
41c370b97bb5792ef0d2a741cd459b83
|
|
| BLAKE2b-256 |
b1eba5a5bfcde26fe75eaf0b05e81757458afae02160894a5edf6455b8e2efb3
|
File details
Details for the file zisu_app_sdk-0.4.0-py3-none-any.whl.
File metadata
- Download URL: zisu_app_sdk-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.6 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 |
4c9d1ca0f3735d72814a2861d6fc8375e0a175c3830294c8cb94abd368092bc0
|
|
| MD5 |
e69c4f65bf5355c3812cbafd316ddabe
|
|
| BLAKE2b-256 |
a757eef18f588e4bf478bde818409b048af8051d0dca0ffc50f56978acc20228
|