fastapi-keycloak


Namefastapi-keycloak JSON
Version 1.0.11 PyPI version JSON
download
home_page
SummaryKeycloak API Client for integrating authentication and authorization with FastAPI
upload_time2024-02-29 11:49:34
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords keycloak fastapi authentication authorization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FastAPI Keycloak Integration

![Py3.8](https://img.shields.io/badge/-Python%203.8-brightgreen)
![Py3.9](https://img.shields.io/badge/-Python%203.9-brightgreen)
![Py3.10](https://img.shields.io/badge/-Python%203.10-brightgreen)

## Introduction

Welcome to `fastapi-keycloak`. This projects goal is to ease the integration of Keycloak (OpenID Connect) with Python, especially FastAPI. FastAPI is not necessary but is
encouraged due to specific features. Currently, this package supports only the `password` and the `authorization_code`. However, the `get_current_user()` method accepts any JWT
that was signed using Keycloak´s private key.

## Docs

Docs are available at [https://fastapi-keycloak.code-specialist.com/](https://fastapi-keycloak.code-specialist.com/).

## TLDR

FastAPI Keycloak enables you to do the following things without writing a single line of additional code:

- Verify identities and roles of users with Keycloak
- Get a list of available identity providers
- Create/read/delete users
- Create/read/delete roles
- Create/read/delete/assign groups (recursive). Thanks to @fabiothz
- Assign/remove roles from users
- Implement the `password` or the `authorization_code` flow (login/callback/logout)

## Contributions

We would like encourage anyone using this package to contribute to its improvement, if anything isn't working as expected or isn't well enough documented, please open an issue or a
pull request. Please note that for any code contribution tests are required.

### Testing

Tests are stored and executed in `./tests`. To test the package, it is necessary to use the `start_infra.sh` script upfront, to set up Keycloak and Postgres. We do this to avoid
artificial testing conditions that occur by mocking all the keycloak requests. The issue here is that we currently see no way to offer public testing opportunities without
significant security issues, which is why you have to run these tests locally and provide a `test_coverage.xml` file. The test coverage is configured in the `pytest.ini` and will
be created once the tests finished running (locally).

## Original authors

Shoutout to the original authors of this project:

- Yannic Schröer @yannicschroeer
- Jonas Scholl @JonasScholl

This project was in the [Code Specialist organization](https://github.com/code-specialist/) before being moved here.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fastapi-keycloak",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Alex Barcel\u00f3 <alex@betarho.net>",
    "keywords": "Keycloak,FastAPI,Authentication,Authorization",
    "author": "",
    "author_email": "Jonas Scholl <jonas@code-specialist.com>, Yannic Schr\u00f6er <yannic@code-specialist.com>, Alex Barcel\u00f3 <alex@betarho.net>",
    "download_url": "https://files.pythonhosted.org/packages/f0/21/7fce6049d437ec058c21c373a89a1f81721cf7bcf299b47ce6506f9aa612/fastapi_keycloak-1.0.11.tar.gz",
    "platform": null,
    "description": "# FastAPI Keycloak Integration\n\n![Py3.8](https://img.shields.io/badge/-Python%203.8-brightgreen)\n![Py3.9](https://img.shields.io/badge/-Python%203.9-brightgreen)\n![Py3.10](https://img.shields.io/badge/-Python%203.10-brightgreen)\n\n## Introduction\n\nWelcome to `fastapi-keycloak`. This projects goal is to ease the integration of Keycloak (OpenID Connect) with Python, especially FastAPI. FastAPI is not necessary but is\nencouraged due to specific features. Currently, this package supports only the `password` and the `authorization_code`. However, the `get_current_user()` method accepts any JWT\nthat was signed using Keycloak\u00b4s private key.\n\n## Docs\n\nDocs are available at [https://fastapi-keycloak.code-specialist.com/](https://fastapi-keycloak.code-specialist.com/).\n\n## TLDR\n\nFastAPI Keycloak enables you to do the following things without writing a single line of additional code:\n\n- Verify identities and roles of users with Keycloak\n- Get a list of available identity providers\n- Create/read/delete users\n- Create/read/delete roles\n- Create/read/delete/assign groups (recursive). Thanks to @fabiothz\n- Assign/remove roles from users\n- Implement the `password` or the `authorization_code` flow (login/callback/logout)\n\n## Contributions\n\nWe would like encourage anyone using this package to contribute to its improvement, if anything isn't working as expected or isn't well enough documented, please open an issue or a\npull request. Please note that for any code contribution tests are required.\n\n### Testing\n\nTests are stored and executed in `./tests`. To test the package, it is necessary to use the `start_infra.sh` script upfront, to set up Keycloak and Postgres. We do this to avoid\nartificial testing conditions that occur by mocking all the keycloak requests. The issue here is that we currently see no way to offer public testing opportunities without\nsignificant security issues, which is why you have to run these tests locally and provide a `test_coverage.xml` file. The test coverage is configured in the `pytest.ini` and will\nbe created once the tests finished running (locally).\n\n## Original authors\n\nShoutout to the original authors of this project:\n\n- Yannic Schr\u00f6er @yannicschroeer\n- Jonas Scholl @JonasScholl\n\nThis project was in the [Code Specialist organization](https://github.com/code-specialist/) before being moved here.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Keycloak API Client for integrating authentication and authorization with FastAPI",
    "version": "1.0.11",
    "project_urls": {
        "Documentation": "https://fastapi-keycloak.code-specialist.com/",
        "repository": "https://github.com/fastapi-keycloak/fastapi-keycloak"
    },
    "split_keywords": [
        "keycloak",
        "fastapi",
        "authentication",
        "authorization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2bd08ee05c2e39156a51790e3bf3e723f211ca302d95248ef4f7f15191f56cd",
                "md5": "391420df6e2f1d923f9abf670890e2b4",
                "sha256": "2d2da95cc9bfd2c02f80bbff3bd4ed985d398a07354da917ee4f7e6416373b29"
            },
            "downloads": -1,
            "filename": "fastapi_keycloak-1.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "391420df6e2f1d923f9abf670890e2b4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19187,
            "upload_time": "2024-02-29T11:49:33",
            "upload_time_iso_8601": "2024-02-29T11:49:33.355794Z",
            "url": "https://files.pythonhosted.org/packages/b2/bd/08ee05c2e39156a51790e3bf3e723f211ca302d95248ef4f7f15191f56cd/fastapi_keycloak-1.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0217fce6049d437ec058c21c373a89a1f81721cf7bcf299b47ce6506f9aa612",
                "md5": "da3ef1828f67fff5ecdf3049d101f4c7",
                "sha256": "e3b4e290bfbc47077cb9bca33f6bac758216a40bfd9fe13c843c71d56087e20c"
            },
            "downloads": -1,
            "filename": "fastapi_keycloak-1.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "da3ef1828f67fff5ecdf3049d101f4c7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 23224,
            "upload_time": "2024-02-29T11:49:34",
            "upload_time_iso_8601": "2024-02-29T11:49:34.744687Z",
            "url": "https://files.pythonhosted.org/packages/f0/21/7fce6049d437ec058c21c373a89a1f81721cf7bcf299b47ce6506f9aa612/fastapi_keycloak-1.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-29 11:49:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fastapi-keycloak",
    "github_project": "fastapi-keycloak",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fastapi-keycloak"
}
        
Elapsed time: 6.67580s