WireCloud extension supporting authentication with Keycloak IDM
Project description
WireCloud Keycloak plugin
This WireCloud plugin allows the usage of Keycloak as IDM for the authentication of WireCloud users as well as the usage of JWT tokens issued for those users to access to backend services.
This plugin can be installed with pip as follows:
pip install wirecloud-keycloak
Or using the sources:
python setup.py develop
Once installed, it can be enabled by including wirecloud.keycloak and social_django in INSTALLED_APPS setting, and addiding KeycloakOAuth2 as an authentication backend.
INSTALLED_APPS += (
# 'django.contrib.sites',
# 'wirecloud.oauth2provider',
'wirecloud.keycloak',
'haystack',
'social_django'
)
AUTHENTICATION_BACKENDS = ('wirecloud.keycloak.social_auth_backend.KeycloakOAuth2',)
Finally the following settings need to be included in setting.py file.
IDM_BACKEND = 'keycloak'
KEYCLOAK_IDM_SERVER = 'http://keycloak.docker:8080'
KEYCLOAK_REALM = 'demo'
KEYCLOAK_KEY = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkY9D3w8J/NPtD2DT/fvPwvrU0WBtw7F6mDTV8JG3TjsrQF4HCEjExDYN9M+5GeJTu8WNfDFUzEfuq7OS/3FRLgZJnV0naYlQsH50l5vCzMD2p9vSSECHBDuz/woObHujgtQckPDv7wyWjihn4EJthI4K08Fb06quijux0M+mazF5WDqlOy3UuKlfERv8JskpOBjwnhCMwz5zv/ox8Y++AiBXlL4stqok29AXANt29+A8LvYDNXiSYuHZJeAk3oxI7G8PYQHFOTynR41hm8xNxPf8YSx2nS7ZfHBPtt9rz7QdPZ9LmXwKPpo+ml92YfHSPcmW2beOuILJ1DW8ZO5eZQIDAQAB'
SOCIAL_AUTH_KEYCLOAK_KEY = 'wirecloud'
SOCIAL_AUTH_KEYCLOAK_SECRET = '7667d30b-4e1a-4dfe-a040-0b6fdc4758f5'
KEYCLOAK_GLOBAL_ROLE = True
These settings include:
- IDM_BACKEND: This WireCloud setting needs to be set to keycloak, to avoid the usage of default Keyrock IDM
- KEYCLOAK_IDM_SERVER: URL of the Keycloak instance
- KEYCLOAK_REALM: Keycloak realm where WireCloud is registered
- KEYCLOAK_KEY: RSA Key used to decode JWT
- SOCIAL_AUTH_KEYCLOAK_KEY: Client ID of the WireCloud application
- SOCIAL_AUTH_KEYCLOAK_SECRET: Client secret of the WireCloud application
- KEYCLOAK_GLOBAL_ROLE: Whether the admin role is taken from the realm instead of from the client (default: False)
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
wirecloud-keycloak-0.1.1.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for wirecloud_keycloak-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4a8280bbc11d03ff515b2c0beb4c0a7b93cec0cd1869848df564136ee8a5f18 |
|
MD5 | 803f7499b95b75e91fc66b2d83a9c687 |
|
BLAKE2b-256 | 48e8eab49586db8b2a5b09bd0116ff6e9edff09288459160c52fdd3e2104fbf2 |