Skip to main content

IBM SSO Self-Service Provisioner

Project description

ibm-sso

When using SSO Self-Service Provisioner for single sign-on, ibm-sso can make your work easier.

Currently only supports fastapi applications.

Getting Started

pip install ibm-sso

Usage

  1. Add ibm-sso to requirements.txt

    ibm-sso==0.3.1
    

    For versions lower than 0.3.0, the token is returned directly after successful authentication.

    Starting from version 0.3.0, you need to create your own nonce on the client side and then pass that nonce along with the redirect_uri to the server side. code and state are returned after successful authentication. You need to use the code, state, nonce and redirect_uri to obtain token information.

  2. Set environment variables

    Refer to the .env.template in the examples directory.

  3. Import ibm-sso in startup file

    Refer to the main.py in the examples directory.

  4. Protect your API

    If your API requires authentication to access, you can refer to example.py

Examples

There is a full example in the examples directory that can be run directly. You can start from the example to learn how to use ibm-sso.

Deploy project(memo for developer)

  1. Deploy project

    # https://test.pypi.org/
    expect interactive_deploy_test.expect
    
    # https://pypi.org/
    # expect interactive_deploy.expect
    
  2. Use test.pypi.org

    pip install -i https://test.pypi.org/simple/ ibm-sso
    
  3. How to mark a version as yanked

    twine yank <package_name> --version <version> --reason "Reason this release was yanked: Yanked due to <reason>"
    

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.0.1] - 2023-11-28

  • First commit

[0.0.2] - 2023-12-06

  • Add avatar to UserInfoVO

[0.0.3] - 2023-12-06

Added

  • Add avatar to UserInfoVO when the user authenticates.

[0.0.4] - 2024-02-21

Fixed

  • Fixed mismatching_state and invalid_grant error.

[0.0.5] - 2024-07-22

Fixed

  • Fixed pydantic.errors.PydanticUserError: Cannot create a Pydantic dataclass from UserInfoVO as it is already a Pydantic model.

[0.3.0] - 2024-10-24

Updated

  • Replace token with code and state

  • Add /token and /introspect api.

  • Modify the environment from W3ID_ENDPOINT_DISCOVERY to W3ID_SERVER_METADATA_URL

  • Use AsyncOAuth2Client to replace OAuth2Session.

[0.3.1] - 2025-05-28

Added

  • Add get_current_user_for_middleware for FastAPI middleware.

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

ibm_sso-0.3.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

ibm_sso-0.3.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file ibm_sso-0.3.1.tar.gz.

File metadata

  • Download URL: ibm_sso-0.3.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for ibm_sso-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9e61d98b33b4c57ef1a22c9db2ad3b5ab33db215c17b062867e3f7f1eac81fcf
MD5 1f5491a2a9bce0e8af3e795e319e96dc
BLAKE2b-256 1cf1bb1b61eb9c0ead51e9667a366b03401c0435f0d485c044a60fb505b29b52

See more details on using hashes here.

File details

Details for the file ibm_sso-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: ibm_sso-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for ibm_sso-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bef0a022bd30fd2e528ab87670ad990aef7d9a5a097cd9478dda1fd2225a2026
MD5 19eb3fd231381745df7205c854ec5f63
BLAKE2b-256 152e3aff2940895264669d4df422cadcdccc3585ab8f28168891faa2a9f2c430

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