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.1.0.tar.gz (9.0 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.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file zisu_app_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: zisu_app_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 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.1.0.tar.gz
Algorithm Hash digest
SHA256 13a0fa2a0d6fe6f48e9dfb6c1be6ced6341b7fb994fa3a7482e13e818e5663a8
MD5 00fe7ebf6fe5171cc1ee9a27d731c8d0
BLAKE2b-256 80d8101129b805902cad8b4fbf6e6bf10434a9a84efba1279ca6499c14ccfe03

See more details on using hashes here.

File details

Details for the file zisu_app_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zisu_app_sdk-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c40f5fb1d307a4188dcb85570667eff94307cba7d0d42f2e7ad13a4cec64304e
MD5 ac013e4e02d04cf83377a82e7d5446c7
BLAKE2b-256 80de853af83c804102018db71a2cb6b15c97f9d6afdde32fdafa306c5505de87

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