ibm-sso


Nameibm-sso JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/xiaobitipao/ibm-sso
SummaryIBM SSO Self-Service Provisioner
upload_time2024-10-24 07:22:40
maintainerNone
docs_urlNone
authorxiaobitipao
requires_python>=3.10
licenseBSD-3-Clause
keywords sso fastapi oidc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            - [ibm-sso](#ibm-sso)
  - [Getting Started](#getting-started)
  - [Usage](#usage)
  - [Sample](#sample)
  - [Deploy project(memo for developer)](#deploy-projectmemo-for-developer)

# 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

```bash
pip install ibm-sso
```

## Usage

1. Add `ibm-sso` to `requirements.txt`

    ```bash
    ibm-sso==0.3.0
    ```

    > 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. Install `ibm-sso` from `requirements.txt` file

    ```bash
    pipenv install -r requirements.txt
    ```

3. Set environment variables

    Refer to the [.env.template](./sample/.env.template) in the sample directory.

4. Import `ibm-sso` in startup file

    Refer to the [app.py](./sample/app.py) in the sample directory.

5. Protect your API

    If your API requires authentication to access, you can refer to [sample.py](./sample/api/v1/sample.py)

## Sample

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

## Deploy project(memo for developer)

1. Deploy project

    ```bash
    # https://test.pypi.org/
    expect interactive_deploy_test.expect

    # https://pypi.org/
    # expect interactive_deploy.expect
    ```

2. Use `test.pypi.org`

    ```bash
    pipenv install -i https://test.pypi.org/simple/ ibm-sso
    ```

3. How to mark a version as yanked

    ```bash
    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](https://keepachangelog.com/en/1.0.0/), and this
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/xiaobitipao/ibm-sso",
    "name": "ibm-sso",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "sso, fastapi, oidc",
    "author": "xiaobitipao",
    "author_email": "xiaobitipao@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/88/b7/215ff216d32143dd3d63065133957b2b3e384ea55a08ad16abde70defc91/ibm_sso-0.3.0.tar.gz",
    "platform": null,
    "description": "- [ibm-sso](#ibm-sso)\n  - [Getting Started](#getting-started)\n  - [Usage](#usage)\n  - [Sample](#sample)\n  - [Deploy project(memo for developer)](#deploy-projectmemo-for-developer)\n\n# ibm-sso\n\nWhen using `SSO Self-Service Provisioner` for single sign-on, `ibm-sso` can make your work easier.\n\n> Currently only supports fastapi applications.\n\n## Getting Started\n\n```bash\npip install ibm-sso\n```\n\n## Usage\n\n1. Add `ibm-sso` to `requirements.txt`\n\n    ```bash\n    ibm-sso==0.3.0\n    ```\n\n    > For versions lower than `0.3.0`, the `token` is returned directly after successful authentication.\n    > \n    > 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.\n\n2. Install `ibm-sso` from `requirements.txt` file\n\n    ```bash\n    pipenv install -r requirements.txt\n    ```\n\n3. Set environment variables\n\n    Refer to the [.env.template](./sample/.env.template) in the sample directory.\n\n4. Import `ibm-sso` in startup file\n\n    Refer to the [app.py](./sample/app.py) in the sample directory.\n\n5. Protect your API\n\n    If your API requires authentication to access, you can refer to [sample.py](./sample/api/v1/sample.py)\n\n## Sample\n\nThere is a full sample in the `sample` directory that can be run directly. You can start from the sample to learn how to use `ibm-sso`.\n\n## Deploy project(memo for developer)\n\n1. Deploy project\n\n    ```bash\n    # https://test.pypi.org/\n    expect interactive_deploy_test.expect\n\n    # https://pypi.org/\n    # expect interactive_deploy.expect\n    ```\n\n2. Use `test.pypi.org`\n\n    ```bash\n    pipenv install -i https://test.pypi.org/simple/ ibm-sso\n    ```\n\n3. How to mark a version as yanked\n\n    ```bash\n    twine yank <package_name> --version <version> --reason \"Reason this release was yanked: Yanked due to <reason>\"\n    ```\n\n# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this\nproject adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [0.0.1] - 2023-11-28\n\n-   First commit\n\n## [0.0.2] - 2023-12-06\n\n-   Add avatar to UserInfoVO\n\n## [0.0.3] - 2023-12-06\n\n**Added**\n\n-   Add avatar to UserInfoVO when the user authenticates.\n\n## [0.0.4] - 2024-02-21\n\n**Fixed**\n\n-   Fixed mismatching_state and invalid_grant error.\n\n## [0.0.5] - 2024-07-22\n\n**Fixed**\n\n-   Fixed pydantic.errors.PydanticUserError: Cannot create a Pydantic dataclass from UserInfoVO as it is already a Pydantic model.\n\n## [0.3.0] - 2024-10-24\n\n**Updated**\n\n-   Replace token with code and state\n\n-   Add `/token` and `/introspect` api.\n\n-   Modify the environment from `W3ID_ENDPOINT_DISCOVERY` to `W3ID_SERVER_METADATA_URL`\n\n-   Use AsyncOAuth2Client to replace OAuth2Session.\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "IBM SSO Self-Service Provisioner",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/xiaobitipao/ibm-sso"
    },
    "split_keywords": [
        "sso",
        " fastapi",
        " oidc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f49b05d0277027b9847f52be61744f6d21784185950cab3a9df9d347adf4518c",
                "md5": "e735c61178ae1a67eaa482d0133fc86b",
                "sha256": "652afeffb21ea05d2350687b41010ca335950c0f42e3f6641f6f5d95673d4e71"
            },
            "downloads": -1,
            "filename": "ibm_sso-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e735c61178ae1a67eaa482d0133fc86b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 9735,
            "upload_time": "2024-10-24T07:22:38",
            "upload_time_iso_8601": "2024-10-24T07:22:38.264929Z",
            "url": "https://files.pythonhosted.org/packages/f4/9b/05d0277027b9847f52be61744f6d21784185950cab3a9df9d347adf4518c/ibm_sso-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88b7215ff216d32143dd3d63065133957b2b3e384ea55a08ad16abde70defc91",
                "md5": "5ef494f19a8a5bf1f97d6efa35c871ca",
                "sha256": "9414dc5c979204f1e979ecc30ad22dacaa80fc4410336a6ce7e1785e8c0ecd34"
            },
            "downloads": -1,
            "filename": "ibm_sso-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5ef494f19a8a5bf1f97d6efa35c871ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10475,
            "upload_time": "2024-10-24T07:22:40",
            "upload_time_iso_8601": "2024-10-24T07:22:40.005592Z",
            "url": "https://files.pythonhosted.org/packages/88/b7/215ff216d32143dd3d63065133957b2b3e384ea55a08ad16abde70defc91/ibm_sso-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-24 07:22:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xiaobitipao",
    "github_project": "ibm-sso",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ibm-sso"
}
        
Elapsed time: 8.97316s