Skip to main content

TU-Berlin Isis Shibboleth login library

Project description

Shisis

Shisis (Shibboleth ISIS) is a small library to handle authentication for TU-Berlin's Moodle instance "ISIS" via Shibboleth.

Install

pip install shisis-async

Usage

CLI

$ shisis -h
usage: shisis [-h] [-u USERNAME] [-p PASSWORD] [-t | -r]

options:
  -h, --help            show this help message and exit
  -u, --username USERNAME
                        Shibboleth username (environment: SHISIS_USER)
  -p, --password PASSWORD
                        Shibboleth password (environment: SHISIS_PASS)
  -t, --token           Only print token
  -r, --private-token   Only print private_token

Code

import asyncio

import aiohttp
from shisis import Shisis


async def main():
    async with aiohttp.ClientSession() as session:
        shisis = Shisis(session)
        public_config = Shisis.PublicConfig(
            launchurl="https://isis.tu-berlin.de/admin/tool/mobile/launch.php",
            httpswwwroot="https://isis.tu-berlin.de",
        )
        identity_providers = Shisis.IdentityProvider(
            url="https://isis.tu-berlin.de/auth/shibboleth/index.php"
        )
        tokens = await shisis.authenticate(
            "username", "password", public_config, identity_providers
        )
        print(tokens)


asyncio.run(main())

Code with poodle_async_full

import asyncio
import os

import aiohttp
from poodle_async_full import ApiClient, Configuration, DefaultApi
from shisis import Shisis


async def main():
    configuration = Configuration(host="https://isis.tu-berlin.de")

    async with ApiClient(configuration) as client:
        poodle = DefaultApi(client)
        config = await poodle.tool_mobile_get_public_config()

        async with aiohttp.ClientSession() as shisis_client:
            shisis = Shisis(shisis_client)
            tokens = await shisis.authenticate(
                "username",
                "password",
                config,
                config.identityproviders,
            )
            configuration.api_key["wstoken"] = tokens.token

        site_info = await poodle.core_webservice_get_site_info()
        print(site_info.userid)


asyncio.run(main())

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

shisis_async-1.2.0.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

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

shisis_async-1.2.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file shisis_async-1.2.0.tar.gz.

File metadata

  • Download URL: shisis_async-1.2.0.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shisis_async-1.2.0.tar.gz
Algorithm Hash digest
SHA256 df5d518dcac6270e3a6be9bed6a8e707ef74e2da16c8971dbdc8666ecbe0c2dd
MD5 3f26f6141e2823693f65c52f12a64c52
BLAKE2b-256 af9d38d010ddb0f7e19f2e3dd4b7785104a6c929cc5d3dd085a7ebc26fed3b5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for shisis_async-1.2.0.tar.gz:

Publisher: publish.yml on bchmnn/shisis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shisis_async-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: shisis_async-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shisis_async-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d034beb777b6daf9df4719dcc6dc3bf732f8ea042a438b9222b152dcc808091
MD5 95986f90828d24915819070de3d45c89
BLAKE2b-256 e218f3d9e2b1ce1eaf6592943b32d36b660e2514c39dfc235ea55ff95cd0a6f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for shisis_async-1.2.0-py3-none-any.whl:

Publisher: publish.yml on bchmnn/shisis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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