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.2.0.tar.gz
(9.1 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.2.0.tar.gz.
File metadata
- Download URL: zisu_app_sdk-0.2.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ef0ecb254fd567f1c40d089dc27912b9a8eb47de981ea1f6d72c8b8b727ceba
|
|
| MD5 |
a0ffc015958c8a1214b17a2eeb6afd08
|
|
| BLAKE2b-256 |
2e76f56b39cb919e1458805765c099def8c3a5bb42ed839443068a462e3784f5
|
File details
Details for the file zisu_app_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: zisu_app_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.5 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 |
d5ea33973f0b81b51f17eddc07d6e845900c0178250b2e130746dbc239a6f126
|
|
| MD5 |
d48cac7124928181cb5923c3f64f1706
|
|
| BLAKE2b-256 |
2edca43dcb2697dff834cb81a9fc4b34d0017df00c2ab5cf1bfc02932116a6ac
|