Keycloak Authenticator
Project description
Keycloak-Basic
All the libraries I found for Keycloak are outdated and not nearly generic enough, so here's a new one.
Documentation
Installing
python -m pip install keycloak-basic
Usage
from keycloak import Keycloak, Token, UserInfo
keycloak: Keycloak = Keycloak(
"http(s)://<host>:<port>", # Keycloak server URL with no trailing path
"<realm name>", # Name of realm to authenticate in
"<client id>", # Client ID
client_secret = "<client secret" # Client secret, if present
)
token: Token = keycloak.auth(
"<username>", # User username
"<password>" # User password
) -> Token
token.authenticated # Boolean, true if logged in
token.isScoped("scope") -> bool # True if current token has scope
info: UserInfo = token.info() -> UserInfo object
token.refresh() # Refreshes connection
token.logout() # Logs out
keycloak.load_token(token.content) -> Token # Loads token from dict
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
keycloak-basic-1.2.1.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file keycloak-basic-1.2.1.tar.gz
.
File metadata
- Download URL: keycloak-basic-1.2.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce38790361a87bc3f5b2551a06b77ecb1cdf4dc885f13a091fd9b3946d858989 |
|
MD5 | 945bde40bf0a4e6833abfc3e03a64495 |
|
BLAKE2b-256 | 7a54354c7dda8cc4485974454fb8df502174de1e6a5abbc5cc465f89a39b540c |
File details
Details for the file keycloak_basic-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: keycloak_basic-1.2.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd5b924bf53d68792a487e1201a1ace62db54ae5e108c7b285c44268d4590013 |
|
MD5 | 2063a0489ec377b502f4bbf5e2ba630b |
|
BLAKE2b-256 | 05bb919cc1dcd7e15747927f46421d4b404e634007974d158d5c2d2951797360 |