Skip to main content

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/zisu
  • GET /auth/zisu/callback
  • POST /auth/zisu/embed
  • GET /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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zisu_app_sdk-0.4.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

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

Hashes for zisu_app_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 09de54aa8bed1665d64a2404291495f2cf18acdfd4188c60cd3ab29ad4083862
MD5 41c370b97bb5792ef0d2a741cd459b83
BLAKE2b-256 b1eba5a5bfcde26fe75eaf0b05e81757458afae02160894a5edf6455b8e2efb3

See more details on using hashes here.

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

Hashes for zisu_app_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c9d1ca0f3735d72814a2861d6fc8375e0a175c3830294c8cb94abd368092bc0
MD5 e69c4f65bf5355c3812cbafd316ddabe
BLAKE2b-256 a757eef18f588e4bf478bde818409b048af8051d0dca0ffc50f56978acc20228

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