keycloak-api-manager


Namekeycloak-api-manager JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryKeycloak API for management
upload_time2023-05-26 09:39:27
maintainer
docs_urlNone
author
requires_python>=3.5
licenseMIT License
keywords keycloak api keycloak api management
VCS
bugtrack_url
requirements requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # KeycloakAPIManager
API for Keycloak management
<br/>


**CLIENT_ID** = "test_client_name" <br/>
**REALM_NAME** = "realm_name" <br/>
**CLIENT_SECRET** = "40j32-5860-4d79-ad16-9c39897w083" <br/>
**USERNAME** = "username@gmail.com"   - User name with admin's rules <br/> 
**PASSWORD** = "f232@3s456S#422" <br/>
**SERVER_URL** = "http://localhost:8080/auth/" - url keykcloak server <br/>
<br/>


# Installation

```pip install keycloak-api-manager```

# Example
### Create it
Create a file ```main.py``` with:
```
from keycloak_api_manager import KeycloakAPIManager

CLIENT_ID = "test_client_name"
REALM_NAME = "realm_name"
CLIENT_SECRET = "40j32-5860-4d79-ad16-9c39897w083"
USERNAME = 'username@gmail.com'                         # KEYCLOAK user's USERNAME or EMAIL User with admin's
PASSWORD = 'f232@3s456S#422'
SERVER_URL = "http://localhost:8080/auth/"              # KEYCLOAK URL http://localhost:8080/auth/ or
                                                        # http://server_url/auth/


keycloak_api = KeycloakAPIManager(keycloak_url=SERVER_URL, realm_name=REALM_NAME,
                           client_id=CLIENT_ID, client_secret=CLIENT_SECRET,
                           admin_username=USERNAME, admin_password=PASSWORD)

about_me = keycloak_api.get_info_about_me()
print(about_me)
```

### Run it
Run a file: ```main.py```

<br/>

___

### Create user


Method **Create_user** with parameter _**payload**_  <br/>
    `create_user(payload=payload)`<br/>

    payload = {
        "username": "some_user",
        "attributes": {"phoneNumber": "1234567890"}, # optional field 
        "enabled": True,
        "credentials": [{"temporary": False, "value": "raw_password"}]
    }

### Editing user


Method **Update_user** with parameter _**payload**_ and  **_user_id_** <br/>
    `update_user(payload=payload_update, user_id="090798-bdaf-4bfb-969b-efc862eaa")`<br/>

    payload_update = {
        "attributes": {
            "phoneNumber": "1234567890",
            "testKey": "testValue"
        }
    }


____

### All functions see on page [Documentation](https://github.com/martinlauren55/keycloakAPI/blob/main/DOCS/DOCS.md)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "keycloak-api-manager",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "keycloak,API,keycloak API management",
    "author": "",
    "author_email": "Polyakov Sergey <martinlauren555@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/6a/db/457f0b631624d2f200a4793e05087930957aa389ed1e5304568af18e97e9/keycloak_api_manager-1.0.1.tar.gz",
    "platform": null,
    "description": "# KeycloakAPIManager\r\nAPI for Keycloak management\r\n<br/>\r\n\r\n\r\n**CLIENT_ID** = \"test_client_name\" <br/>\r\n**REALM_NAME** = \"realm_name\" <br/>\r\n**CLIENT_SECRET** = \"40j32-5860-4d79-ad16-9c39897w083\" <br/>\r\n**USERNAME** = \"username@gmail.com\"   - User name with admin's rules <br/> \r\n**PASSWORD** = \"f232@3s456S#422\" <br/>\r\n**SERVER_URL** = \"http://localhost:8080/auth/\" - url keykcloak server <br/>\r\n<br/>\r\n\r\n\r\n# Installation\r\n\r\n```pip install keycloak-api-manager```\r\n\r\n# Example\r\n### Create it\r\nCreate a file ```main.py``` with:\r\n```\r\nfrom keycloak_api_manager import KeycloakAPIManager\r\n\r\nCLIENT_ID = \"test_client_name\"\r\nREALM_NAME = \"realm_name\"\r\nCLIENT_SECRET = \"40j32-5860-4d79-ad16-9c39897w083\"\r\nUSERNAME = 'username@gmail.com'                         # KEYCLOAK user's USERNAME or EMAIL User with admin's\r\nPASSWORD = 'f232@3s456S#422'\r\nSERVER_URL = \"http://localhost:8080/auth/\"              # KEYCLOAK URL http://localhost:8080/auth/ or\r\n                                                        # http://server_url/auth/\r\n\r\n\r\nkeycloak_api = KeycloakAPIManager(keycloak_url=SERVER_URL, realm_name=REALM_NAME,\r\n                           client_id=CLIENT_ID, client_secret=CLIENT_SECRET,\r\n                           admin_username=USERNAME, admin_password=PASSWORD)\r\n\r\nabout_me = keycloak_api.get_info_about_me()\r\nprint(about_me)\r\n```\r\n\r\n### Run it\r\nRun a file: ```main.py```\r\n\r\n<br/>\r\n\r\n___\r\n\r\n### Create user\r\n\r\n\r\nMethod **Create_user** with parameter _**payload**_  <br/>\r\n    `create_user(payload=payload)`<br/>\r\n\r\n    payload = {\r\n        \"username\": \"some_user\",\r\n        \"attributes\": {\"phoneNumber\": \"1234567890\"}, # optional field \r\n        \"enabled\": True,\r\n        \"credentials\": [{\"temporary\": False, \"value\": \"raw_password\"}]\r\n    }\r\n\r\n### Editing user\r\n\r\n\r\nMethod **Update_user** with parameter _**payload**_ and  **_user_id_** <br/>\r\n    `update_user(payload=payload_update, user_id=\"090798-bdaf-4bfb-969b-efc862eaa\")`<br/>\r\n\r\n    payload_update = {\r\n        \"attributes\": {\r\n            \"phoneNumber\": \"1234567890\",\r\n            \"testKey\": \"testValue\"\r\n        }\r\n    }\r\n\r\n\r\n____\r\n\r\n### All functions see on page [Documentation](https://github.com/martinlauren55/keycloakAPI/blob/main/DOCS/DOCS.md)\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Keycloak API for management",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://github.com/martinlauren55/keycloak-api-manager/blob/main/DOCS/DOCS.md",
        "Homepage": "https://github.com/martinlauren55/keycloak-api-manager",
        "Repository": "https://github.com/martinlauren55/keycloak-api-manager.git"
    },
    "split_keywords": [
        "keycloak",
        "api",
        "keycloak api management"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f0aef61910c5baf320fa0d7c7c622cedf67a7c3a9f196c85a76a01d4c41a7f5",
                "md5": "e8c2a62e54b9f743f0e0f2e1344d6b3d",
                "sha256": "a87d3cb53b709f35b1dfb3bce5cece28b005aef79b098e8a8060c86faf621adb"
            },
            "downloads": -1,
            "filename": "keycloak_api_manager-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8c2a62e54b9f743f0e0f2e1344d6b3d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 5132,
            "upload_time": "2023-05-26T09:39:25",
            "upload_time_iso_8601": "2023-05-26T09:39:25.890169Z",
            "url": "https://files.pythonhosted.org/packages/7f/0a/ef61910c5baf320fa0d7c7c622cedf67a7c3a9f196c85a76a01d4c41a7f5/keycloak_api_manager-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6adb457f0b631624d2f200a4793e05087930957aa389ed1e5304568af18e97e9",
                "md5": "f5c42b45b6d5dbceec2ee55ba19e526a",
                "sha256": "0b10809311b1ed4aef8e40e79d380ac6fb0db28fea111286e066743691619dea"
            },
            "downloads": -1,
            "filename": "keycloak_api_manager-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f5c42b45b6d5dbceec2ee55ba19e526a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 4489,
            "upload_time": "2023-05-26T09:39:27",
            "upload_time_iso_8601": "2023-05-26T09:39:27.437061Z",
            "url": "https://files.pythonhosted.org/packages/6a/db/457f0b631624d2f200a4793e05087930957aa389ed1e5304568af18e97e9/keycloak_api_manager-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-26 09:39:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "martinlauren55",
    "github_project": "keycloak-api-manager",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "keycloak-api-manager"
}
        
Elapsed time: 1.64582s