Metadata-Version: 2.1
Name: ibm-sso
Version: 0.0.2
Summary: IBM SSO Self-Service Provisioner
Home-page: https://github.com/xiaobitipao/ibm-sso
Author: xiaobitipao
Author-email: xiaobitipao@gmail.com
License: BSD-3-Clause
Keywords: sso,fastapi,oidc
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE

- [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` file

    ```bash
    ibm-sso==0.0.1
    ```

2. Install `ibm-sso` from `requirements.txt` file

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

3. Set environment variables

    Refer to the sample directory.

4. Import `ibm-sso` in startup file

    ```python
    from starlette.middleware.sessions import SessionMiddleware

    app = FastAPI()

    @app.exception_handler(OAuthError)
    async def oauth_error_exception_handler(request, exc: OAuthError):
        return JSONResponse(content={'detail': exc.error}, status_code=status.HTTP_401_UNAUTHORIZED)

    app.add_middleware(SessionMiddleware, secret_key='Change Me to Random Secret!')

    app.include_router(authorize_router, prefix='/oauth2', tags=['Authorize API'])
    ```

5. Now, your application has added SSO authentication functionality.

## Sample

There is a 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)

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

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

# 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
