- [ibm-sso](#ibm-sso)
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Examples](#examples)
- [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.3
```
> 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](./examples/.env.template) in the examples directory.
3. Import `ibm-sso` in startup file
Refer to the [main.py](./examples/src/main.py) in the examples directory.
4. Protect your API
If your API requires authentication to access, you can refer to [example.py](./examples/src/api/v1/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
```bash
# https://test.pypi.org/
expect interactive_deploy_test.expect
# https://pypi.org/
# expect interactive_deploy.expect
```
2. Use `test.pypi.org`
```bash
pip 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.
## [0.3.1] - 2025-05-28
**Added**
- Add `get_current_user_for_middleware` for FastAPI middleware.
## [0.3.2] - 2025-06-23
**Updated**
- Update the W3ID avatar prefix. You can also set it using the `W3ID_AVATAR_PREFIX` environment variable.
## [0.3.3] - 2025-07-18
**Updated**
- Add a `timeout` parameter to `get_current_user` so that users can specify the timeout.
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/67/a3/2f1751cf482e8deaa0b7e0c6437758d30e214f798a0200c9197e3885a0bb/ibm_sso-0.3.3.tar.gz",
"platform": null,
"description": "- [ibm-sso](#ibm-sso)\n - [Getting Started](#getting-started)\n - [Usage](#usage)\n - [Examples](#examples)\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.3\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. Set environment variables\n\n Refer to the [.env.template](./examples/.env.template) in the examples directory.\n\n3. Import `ibm-sso` in startup file\n\n Refer to the [main.py](./examples/src/main.py) in the examples directory.\n\n4. Protect your API\n\n If your API requires authentication to access, you can refer to [example.py](./examples/src/api/v1/example.py)\n\n## Examples\n\nThere 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`.\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 pip 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\n## [0.3.1] - 2025-05-28\n\n**Added**\n\n- Add `get_current_user_for_middleware` for FastAPI middleware.\n\n## [0.3.2] - 2025-06-23\n\n**Updated**\n\n- Update the W3ID avatar prefix. You can also set it using the `W3ID_AVATAR_PREFIX` environment variable.\n\n## [0.3.3] - 2025-07-18\n\n**Updated**\n\n- Add a `timeout` parameter to `get_current_user` so that users can specify the timeout.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "IBM SSO Self-Service Provisioner",
"version": "0.3.3",
"project_urls": {
"Homepage": "https://github.com/xiaobitipao/ibm-sso"
},
"split_keywords": [
"sso",
" fastapi",
" oidc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5605f4ac0ead58705ce17cf408c1c9b68f62dcabae22615ce49537d4f2ac99ec",
"md5": "30021d266f148e42910f28b3d2eb503f",
"sha256": "429b5ff63557884fb9cca90ba3dfa356fc4ad999f8bc58e5bbd10fddce58ced5"
},
"downloads": -1,
"filename": "ibm_sso-0.3.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "30021d266f148e42910f28b3d2eb503f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 15001,
"upload_time": "2025-07-18T08:54:49",
"upload_time_iso_8601": "2025-07-18T08:54:49.975998Z",
"url": "https://files.pythonhosted.org/packages/56/05/f4ac0ead58705ce17cf408c1c9b68f62dcabae22615ce49537d4f2ac99ec/ibm_sso-0.3.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "67a32f1751cf482e8deaa0b7e0c6437758d30e214f798a0200c9197e3885a0bb",
"md5": "4b2d302e45342c7f3c97abae7da19b6b",
"sha256": "98c07def978f7819920906497de5af54e3ed5556ccae21110deeb3f2dccb31f3"
},
"downloads": -1,
"filename": "ibm_sso-0.3.3.tar.gz",
"has_sig": false,
"md5_digest": "4b2d302e45342c7f3c97abae7da19b6b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 11753,
"upload_time": "2025-07-18T08:54:50",
"upload_time_iso_8601": "2025-07-18T08:54:50.987690Z",
"url": "https://files.pythonhosted.org/packages/67/a3/2f1751cf482e8deaa0b7e0c6437758d30e214f798a0200c9197e3885a0bb/ibm_sso-0.3.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-18 08:54:50",
"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"
}