Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dax-dot-gay/keycloak-basic
All the libraries I found for Keycloak are outdated and not *nearly* generic enough, so here's a new one.
https://github.com/dax-dot-gay/keycloak-basic
Last synced: 6 days ago
JSON representation
All the libraries I found for Keycloak are outdated and not *nearly* generic enough, so here's a new one.
- Host: GitHub
- URL: https://github.com/dax-dot-gay/keycloak-basic
- Owner: dax-dot-gay
- License: mit
- Created: 2022-04-25T21:25:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-26T15:57:20.000Z (over 2 years ago)
- Last Synced: 2024-10-13T02:38:11.582Z (about 1 month ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keycloak-Basic
All the libraries I found for Keycloak are outdated and not _nearly_ generic enough, so here's a new one.
## Documentation
**Installing**
```bash
python -m pip install keycloak-basic
```**Usage**
```python
from keycloak import Keycloak, Token, UserInfokeycloak: Keycloak = Keycloak(
"http(s)://:", # Keycloak server URL with no trailing path
"", # Name of realm to authenticate in
"", # Client ID
client_secret = "", # User username
"" # User password
) -> Tokentoken.authenticated # Boolean, true if logged in
token.isScoped("scope") -> bool # True if current token has scopeinfo: UserInfo = token.info() -> UserInfo object
token.refresh() # Refreshes connection
token.logout() # Logs outkeycloak.load_token(token.content) -> Token # Loads token from dict
```