Django Admin Keycloak
Project description
django-admin-keycloak
Keycloak
Create Client OpenID with callback url https://keycloak.example.ru/sso/*
Settings
# define static config or add provider later in admin management
KEYCLOAK_PROVIDERS = [
{
'slug': 'local', # internal django slug
'name': 'Local', # name on login form
'client_id': 'local_django',
'client_secret': 'SECRET',
'redirect_uri': '/admin', # redirect uri after login
'server_url': 'https://keycloak.example.ru',
'realm_name': 'django',
'role_staff_user': 'dev_staff', # role for staff users
'role_super_user': 'dev_super_user', # role for superusers
}
]
Add to urls.py
urlpatterns = [
# ...,
path('sso/', include('django_admin_keycloak.url')),
# ...
]
If you define static config, you must execute command for update providers.
python manage.py update_static_providers
Available signals
user_sso_login
On login SSO user
- session: KeycloakSession
- request: HttpRequest
- userinfo: dict
- access_token: str
user_sso_logout
On logout SSO user
- session: KeycloakSession
- request: HttpRequest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django_admin_keycloak-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24879c941cf9fa42f1a8b7bd6db7692338886c26d8bdb947c4848064bdb57014 |
|
MD5 | dc0106f81057de3f5ef61d68c2c61885 |
|
BLAKE2b-256 | e184fc53e7898d5642a04efcc70fbcc30d894e5ec8694708065967073631f596 |
Close
Hashes for django_admin_keycloak-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35fc580b30da5b4ab335709d91c4b96410996724153b27146f051628ff8e84dc |
|
MD5 | ffeb44c628aadf7c00fd0aeef97770fe |
|
BLAKE2b-256 | 55cc1f2bc680bda08f923fc4742a4d4b509238184c544369e8da681e3788c14b |