Skip to main content

Desktop Typsa SSO helper client for Lambda-based Microsoft auth flows.

Project description

SSO-Package-Pip

Python package to integrate a desktop application with an existing Lambda-based SSO flow.

URL contract

This client builds the SSO trigger URL using only:

  • email
  • redirect_uri

Install (local development)

pip install -e .

Quick start

from sso_typsa import typsaSSOClient

client = TypsaSSOClient(
    authorize_url="https://your-lambda-domain/sso",
    default_redirect_uri="http://127.0.0.1:8765/callback",
)

tokens = client.authenticate(email="user@company.com")

print(tokens.id_token)
print(tokens.refresh_token)

What authenticate(...) does

  • opens the browser to your Lambda SSO URL
  • sends email and redirect_uri as query params
  • waits for redirect callback on localhost
  • returns parsed tokens

Separate desktop app entity

Desktop UI is now kept separate from the package in desktop_app/app.py.

Run from this repository:

pip install -e .
python desktop_app/app.py

This keeps desktop-sso-client as a clean reusable package, while the UI app is a consumer of that package.

Windows custom protocol registration (optional)

If you want browser to redirect directly to installed app, register your scheme in Windows. Example for scheme mydesktopapp:

reg add "HKCU\Software\Classes\mydesktopapp" /ve /d "URL:mydesktopapp Protocol" /f
reg add "HKCU\Software\Classes\mydesktopapp" /v "URL Protocol" /d "" /f
reg add "HKCU\Software\Classes\mydesktopapp\shell\open\command" /ve /d "\"python\" \"C:\path\to\desktop_app\app.py\" --callback-url \"%1\"" /f

After this, a redirect like mydesktopapp://auth/callback?... can open the app.

Web mapping

If web app uses:

const loginUrl = `${environment.ssoUrl}?email=${email}&redirect_uri=${redirectUri}`;
window.location.href = loginUrl;

desktop app equivalent:

tokens = client.authenticate(email="user@company.com")

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

typsa_sso_client-0.1.2.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

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

typsa_sso_client-0.1.2-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file typsa_sso_client-0.1.2.tar.gz.

File metadata

  • Download URL: typsa_sso_client-0.1.2.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for typsa_sso_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 da611ebae11ad3a5650bdaf62e8caef2c962147c221e6ea3b51738867dc68502
MD5 c1ae9eba8317400116d3b0814017443e
BLAKE2b-256 f1de211481fe959d6cf4273e2406e9205099f95227fad7640d779749d4341d13

See more details on using hashes here.

File details

Details for the file typsa_sso_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for typsa_sso_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 495ff62075cc9aadc5c0d7832a321abe01a8583a9cbc51d098303397126d300a
MD5 817c778f7785b859586fa8357bb5144e
BLAKE2b-256 2cab7840446392f46395e6d8348c5ff639f8bb3837e85ff0197a9f0951331b99

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